Skip to content

chase-crumbaugh/supaglue-test

Repository files navigation

supaglue

test

SDK Installation

go get github.com/chase-crumbaugh/supaglue-test

SDK Example Usage

package main

import (
    "context"
    "log"
    "supaglue"
    "supaglue/pkg/models/shared"
    "supaglue/pkg/models/operations"
)

func main() {
    s := sdk.New(
        sdk.WithSecurity(shared.Security{
            APIKeyAuth: shared.SchemeAPIKeyAuth{
                APIKey: "YOUR_API_KEY_HERE",
            },
        }),
    )

    req := operations.CreateAccountRequest{
        Headers: operations.CreateAccountHeaders{
            XCustomerID: "my-customer-1",
            XProviderName: "salesforce",
        },
        Request: operations.CreateAccountRequestBody{
            Model: shared.CreateUpdateAccount{
                Addresses: []shared.Addresses{
                    shared.Addresses{
                        AddressType: "other",
                        City: "San Francisco",
                        Country: "USA",
                        PostalCode: "94107",
                        State: "CA",
                        Street1: "525 Brannan",
                        Street2: "null",
                    },
                    shared.Addresses{
                        AddressType: "billing",
                        City: "San Francisco",
                        Country: "USA",
                        PostalCode: "94107",
                        State: "CA",
                        Street1: "525 Brannan",
                        Street2: "null",
                    },
                    shared.Addresses{
                        AddressType: "shipping",
                        City: "San Francisco",
                        Country: "USA",
                        PostalCode: "94107",
                        State: "CA",
                        Street1: "525 Brannan",
                        Street2: "null",
                    },
                },
                CustomFields: map[string]interface{}{
                    "vero": "perspiciatis",
                    "nulla": "nihil",
                    "fuga": "facilis",
                },
                Description: "Integration API",
                Industry: "API's",
                Name: "Sample Customer",
                NumberOfEmployees: 276000,
                OwnerID: "9f3e97fd-4d5d-4efc-959d-bbebfac079f5",
                PhoneNumbers: []shared.PhoneNumbers{
                    shared.PhoneNumbers{
                        PhoneNumber: "+14151234567",
                        PhoneNumberType: "mobile",
                    },
                    shared.PhoneNumbers{
                        PhoneNumber: "+14151234567",
                        PhoneNumberType: "primary",
                    },
                },
                Website: "https://supaglue.com/",
            },
        },
    }

    ctx := context.Background()
    res, err := s.Accounts.Create(ctx, req)
    if err != nil {
        log.Fatal(err)
    }

    if res.CreateAccount201ApplicationJSONObject != nil {
        // handle response
    }
}

SDK Available Operations

Accounts

  • Create - Create account
  • Get - Get account
  • List - List accounts
  • Search - Search accounts
  • Update - Update account

Contacts

  • Create - Create contact
  • Get - Get contact
  • List - List contacts
  • Search - Search contacts
  • Update - Update contact

Leads

  • Create - Create lead
  • Get - Get lead
  • List - List leads
  • Update - Update lead

Opportunities

  • Create - Create opportunity
  • Get - Get opportunity
  • List - List opportunities
  • Search - Search Opportunities
  • Update - Update opportunity

Passthrough

  • Send - Send passthrough request

Users

  • Get - Get user
  • List - List users

SDK Generated by Speakeasy