Documentation
¶
Index ¶
- func GenerateRandomBytes(n int) ([]byte, error)
- func HashHmacSha1(message string, secret string) string
- func HashHmacSha256(message string, secret string) string
- func JsonDecode(input string) map[string]interface{}
- func JsonEncode(input interface{}) string
- func JsonPrettyPrint(in string) string
- func PercentEncode(input string) string
- func RandInt(min int64, max int64) int64
- func RandString(s int) string
- type NSAddress
- type NSCreditMemo
- type NSCreditMemoApply
- type NSCreditMemoItem
- type NSCustomer
- type NSInvoice
- type NSInvoiceItem
- type NSSalesOrder
- func (this *NSSalesOrder) AddItem(itemToAdd NSSalesOrderItem)
- func (this *NSSalesOrder) SetCurrency(CurrencyExternalId string)
- func (this *NSSalesOrder) SetCustomFormId(CustomFormId string)
- func (this *NSSalesOrder) SetEntity(EntityExternalId string)
- func (this *NSSalesOrder) SetSalesRepId(SalesRepInternalId string)
- func (this *NSSalesOrder) SetSubsidiary(SubsidiaryExternalId string)
- func (this *NSSalesOrder) SetTerms(TermsExternalId string)
- func (this *NSSalesOrder) SetTermsId(TermsInternalId string)
- type NSSalesOrderItem
- type NetSuiteConnector
- func (r *NetSuiteConnector) At(patharg string, args ...interface{}) NetSuiteRequest
- func (r *NetSuiteConnector) DELETE(patharg string, args ...interface{}) string
- func (r *NetSuiteConnector) GET(patharg string, args ...interface{}) string
- func (r *NetSuiteConnector) POST(patharg string, args ...interface{}) string
- func (r *NetSuiteConnector) ReadConfig(path string)
- type NetSuiteRequest
- func (r NetSuiteRequest) DELETE() string
- func (r NetSuiteRequest) GET() string
- func (r NetSuiteRequest) INSERT(post_json interface{}) string
- func (r NetSuiteRequest) PATCH(post_json interface{}) string
- func (r NetSuiteRequest) POST(post_json interface{}) string
- func (r NetSuiteRequest) PUT(post_json interface{}) string
- func (r NetSuiteRequest) Query(QueryParams map[string]string) NetSuiteRequest
- func (r NetSuiteRequest) UPDATE(post_json interface{}) string
- func (r NetSuiteRequest) UPSERT(post_json interface{}) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRandomBytes ¶
func HashHmacSha1 ¶
func HashHmacSha256 ¶
func JsonDecode ¶
func JsonEncode ¶
func JsonEncode(input interface{}) string
func JsonPrettyPrint ¶
func PercentEncode ¶
func RandString ¶
GenerateRandomString returns a URL-safe, base64 encoded securely generated random string.
Types ¶
type NSAddress ¶
type NSAddress struct { Attention string `json:"attention,omitempty"` Addressee string `json:"addressee,omitempty"` AddrPhone string `json:"addrPhone,omitempty"` Addr1 string `json:"addr1,omitempty"` Addr2 string `json:"addr2,omitempty"` Addr3 string `json:"addr3,omitempty"` City string `json:"city,omitempty"` State string `json:"state,omitempty"` Zip string `json:"zip,omitempty"` Country string `json:"country,omitempty"` }
not a complete list of struct fields... just the ones we feel like using in this app for more fields, see: https://system.netsuite.com/help/helpcenter/en_US/APIs/REST_API_Browser/record/v1/2022.1/index.html
type NSCreditMemo ¶
type NSCreditMemo struct { ExternalId string `json:"externalId,omitempty"` Currency map[string]interface{} `json:"currency,omitempty"` TranDate string `json:"tranDate,omitempty"` Entity map[string]interface{} `json:"entity,omitempty"` Item map[string][]NSCreditMemoItem `json:"item,omitempty"` CreatedFrom map[string]interface{} `json:"createdFrom,omitempty"` ApplyList map[string][]NSCreditMemoApply `json:"applyList,omitempty"` }
not a complete list of creditmemo fields... just the ones we feel like using in this app for more fields, see: https://system.netsuite.com/help/helpcenter/en_US/APIs/REST_API_Browser/record/v1/2022.1/index.html
type NSCreditMemoApply ¶
type NSCreditMemoItem ¶
type NSCreditMemoItem struct { Quantity float64 `json:"quantity,omitempty"` Amount float64 `json:"amount,omitempty"` Description string `json:"description,omitempty"` //ProductCache::productName($item_line['product_id']); Item map[string]string `json:"item,omitempty"` //for externalId of ProductId Line int64 `json:"line,omitempty"` OrderLine int64 `json:"orderLine,omitempty"` }
type NSCustomer ¶
type NSCustomer struct { InternalId string `json:"id,omitempty"` ExternalId string `json:"externalId,omitempty"` CompanyName string `json:"companyName,omitempty"` Email string `json:"email,omitempty"` EntityId string `json:"entityId,omitempty"` EntityStatus map[string]interface{} `json:"entityStatus,omitempty"` CustomForm map[string]interface{} `json:"customForm,omitempty"` Terms map[string]interface{} `json:"terms,omitempty"` Subsidiary map[string]interface{} `json:"subsidiary,omitempty"` AccountCreateDate string `json:"custentity_account_create_date,omitempty"` }
not a complete list of struct fields... just the ones we feel like using in this app for more fields, see: https://system.netsuite.com/help/helpcenter/en_US/APIs/REST_API_Browser/record/v1/2022.1/index.html
func UnmarshalJSONToCustomer ¶
func UnmarshalJSONToCustomer(json_input string) *NSCustomer
func (*NSCustomer) SetCustomFormId ¶
func (this *NSCustomer) SetCustomFormId(CustomFormId string)
func (*NSCustomer) SetSubsidiary ¶
func (this *NSCustomer) SetSubsidiary(SubsidiaryExternalId string)
func (*NSCustomer) SetTerms ¶
func (this *NSCustomer) SetTerms(TermsExternalId string)
func (*NSCustomer) SetTermsId ¶
func (this *NSCustomer) SetTermsId(TermsInternalId string)
type NSInvoice ¶
type NSInvoice struct { BillingAddress NSAddress `json:"billingAddress,omitempty"` ShippingAddress NSAddress `json:"shippingAddress,omitempty"` ExternalId string `json:"externalId,omitempty"` InternalId string `json:"internalId,omitempty"` TranDate string `json:"tranDate,omitempty"` Email string `json:"email,omitempty"` OtherRefNum string `json:"otherRefNum,omitempty"` Account map[string]interface{} `json:"account,omitempty"` CreatedFrom map[string]interface{} `json:"createdFrom,omitempty"` CustomForm map[string]interface{} `json:"customForm,omitempty"` Terms map[string]interface{} `json:"terms,omitempty,omitempty"` Currency map[string]interface{} `json:"currency,omitempty"` Entity map[string]interface{} `json:"entity,omitempty"` SalesRep map[string]interface{} `json:"salesRep,omitempty"` Subsidiary map[string]interface{} `json:"subsidiary,omitempty"` Item map[string][]NSInvoiceItem `json:"item,omitempty"` InvoiceMethod string `json:"custbody_invoice_method,omitempty"` //example custom field }
not a complete list of struct fields... just the ones we feel like using in this app for more fields, see: https://system.netsuite.com/help/helpcenter/en_US/APIs/REST_API_Browser/record/v1/2022.1/index.html
func (*NSInvoice) AddItem ¶
func (this *NSInvoice) AddItem(itemToAdd NSInvoiceItem)
type NSInvoiceItem ¶
type NSSalesOrder ¶
type NSSalesOrder struct { InternalId string `json:"internalId,omitempty"` ExternalId string `json:"externalId,omitempty"` CustomForm map[string]interface{} `json:"customForm,omitempty"` Currency map[string]interface{} `json:"currency,omitempty"` Memo string `json:"memo,omitempty"` OtherRefNum string `json:"otherRefNum,omitempty"` TranDate string `json:"tranDate,omitempty"` Entity map[string]interface{} `json:"entity,omitempty"` Item map[string][]NSSalesOrderItem `json:"item,omitempty"` Subsidiary map[string]interface{} `json:"subsidiary,omitempty"` Terms map[string]interface{} `json:"terms,omitempty"` SalesRep map[string]interface{} `json:"salesRep,omitempty"` Message string `json:"message,omitempty"` LineOfBusiness string `json:"class,omitempty"` Email string `json:"email,omitempty"` BillingAddress NSAddress `json:"billingAddress,omitempty"` ShippingAddress NSAddress `json:"shippingAddress,omitempty"` AltLocalName string `json:"custbody_local_name,omitempty"` //example custom field }
not a complete list of salesorder fields... just the ones we feel like using in this app for more fields, see: https://system.netsuite.com/help/helpcenter/en_US/APIs/REST_API_Browser/record/v1/2022.1/index.html
func (*NSSalesOrder) AddItem ¶
func (this *NSSalesOrder) AddItem(itemToAdd NSSalesOrderItem)
----------------------------------------------------------------------
func (*NSSalesOrder) SetCurrency ¶
func (this *NSSalesOrder) SetCurrency(CurrencyExternalId string)
func (*NSSalesOrder) SetCustomFormId ¶
func (this *NSSalesOrder) SetCustomFormId(CustomFormId string)
func (*NSSalesOrder) SetEntity ¶
func (this *NSSalesOrder) SetEntity(EntityExternalId string)
func (*NSSalesOrder) SetSalesRepId ¶
func (this *NSSalesOrder) SetSalesRepId(SalesRepInternalId string)
func (*NSSalesOrder) SetSubsidiary ¶
func (this *NSSalesOrder) SetSubsidiary(SubsidiaryExternalId string)
func (*NSSalesOrder) SetTerms ¶
func (this *NSSalesOrder) SetTerms(TermsExternalId string)
func (*NSSalesOrder) SetTermsId ¶
func (this *NSSalesOrder) SetTermsId(TermsInternalId string)
type NSSalesOrderItem ¶
type NetSuiteConnector ¶
type NetSuiteConnector struct { Auth struct { Account string `yaml:"account"` ConsumerKey string `yaml:"consumerKey"` ConsumerSecret string `yaml:"consumerSecret"` Token string `yaml:"token"` TokenSecret string `yaml:"tokenSecret"` APIURL string `yaml:"apiURL"` } `yaml:"netsuite"` ConfigFile string LastInsertId int LastStatusCode int LastStatus string }
func (*NetSuiteConnector) At ¶
func (r *NetSuiteConnector) At(patharg string, args ...interface{}) NetSuiteRequest
----------------------------------------------------------------------
func (*NetSuiteConnector) DELETE ¶
func (r *NetSuiteConnector) DELETE(patharg string, args ...interface{}) string
----------------------------------------------------------------------
func (*NetSuiteConnector) GET ¶
func (r *NetSuiteConnector) GET(patharg string, args ...interface{}) string
----------------------------------------------------------------------
func (*NetSuiteConnector) POST ¶
func (r *NetSuiteConnector) POST(patharg string, args ...interface{}) string
----------------------------------------------------------------------
func (*NetSuiteConnector) ReadConfig ¶
func (r *NetSuiteConnector) ReadConfig(path string)
----------------------------------------------------------------------
type NetSuiteRequest ¶
type NetSuiteRequest struct { Connection *NetSuiteConnector RequestURL string QueryParams map[string]string RequestBody interface{} //can pass in json encoded string, or a struct or map here }
func (NetSuiteRequest) DELETE ¶
func (r NetSuiteRequest) DELETE() string
----------------------------------------------------------------------
func (NetSuiteRequest) GET ¶
func (r NetSuiteRequest) GET() string
func (NetSuiteRequest) INSERT ¶
func (r NetSuiteRequest) INSERT(post_json interface{}) string
func (NetSuiteRequest) PATCH ¶
func (r NetSuiteRequest) PATCH(post_json interface{}) string
----------------------------------------------------------------------
func (NetSuiteRequest) POST ¶
func (r NetSuiteRequest) POST(post_json interface{}) string
----------------------------------------------------------------------
func (NetSuiteRequest) PUT ¶
func (r NetSuiteRequest) PUT(post_json interface{}) string
----------------------------------------------------------------------
func (NetSuiteRequest) Query ¶
func (r NetSuiteRequest) Query(QueryParams map[string]string) NetSuiteRequest
---------------------------------------------------------------------- ----------------------------------------------------------------------
func (NetSuiteRequest) UPDATE ¶
func (r NetSuiteRequest) UPDATE(post_json interface{}) string
func (NetSuiteRequest) UPSERT ¶
func (r NetSuiteRequest) UPSERT(post_json interface{}) string