Skip to content

sid6mathur/libattio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for libattio

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 2.0.0
  • Package version: 1.0.0
  • Generator version: 7.18.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://attio.com/help

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import libattio "github.com/sid6mathur/libattio"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value libattio.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), libattio.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value libattio.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), libattio.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using libattio.ContextOperationServerIndices and libattio.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), libattio.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), libattio.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://api.attio.com

Class Method HTTP request Description
AttributesAPI V2TargetIdentifierAttributesAttributeGet Get /v2/{target}/{identifier}/attributes/{attribute} Get an attribute
AttributesAPI V2TargetIdentifierAttributesAttributeOptionsGet Get /v2/{target}/{identifier}/attributes/{attribute}/options List select options
AttributesAPI V2TargetIdentifierAttributesAttributeOptionsOptionPatch Patch /v2/{target}/{identifier}/attributes/{attribute}/options/{option} Update a select option
AttributesAPI V2TargetIdentifierAttributesAttributeOptionsPost Post /v2/{target}/{identifier}/attributes/{attribute}/options Create a select option
AttributesAPI V2TargetIdentifierAttributesAttributePatch Patch /v2/{target}/{identifier}/attributes/{attribute} Update an attribute
AttributesAPI V2TargetIdentifierAttributesAttributeStatusesGet Get /v2/{target}/{identifier}/attributes/{attribute}/statuses List statuses
AttributesAPI V2TargetIdentifierAttributesAttributeStatusesPost Post /v2/{target}/{identifier}/attributes/{attribute}/statuses Create a status
AttributesAPI V2TargetIdentifierAttributesAttributeStatusesStatusPatch Patch /v2/{target}/{identifier}/attributes/{attribute}/statuses/{status} Update a status
AttributesAPI V2TargetIdentifierAttributesGet Get /v2/{target}/{identifier}/attributes List attributes
AttributesAPI V2TargetIdentifierAttributesPost Post /v2/{target}/{identifier}/attributes Create an attribute
CallRecordingsAPI V2MeetingsMeetingIdCallRecordingsCallRecordingIdDelete Delete /v2/meetings/{meeting_id}/call_recordings/{call_recording_id} Delete call recording
CallRecordingsAPI V2MeetingsMeetingIdCallRecordingsCallRecordingIdGet Get /v2/meetings/{meeting_id}/call_recordings/{call_recording_id} Get call recording
CallRecordingsAPI V2MeetingsMeetingIdCallRecordingsGet Get /v2/meetings/{meeting_id}/call_recordings List call recordings
CallRecordingsAPI V2MeetingsMeetingIdCallRecordingsPost Post /v2/meetings/{meeting_id}/call_recordings Create call recording
CommentsAPI V2CommentsCommentIdDelete Delete /v2/comments/{comment_id} Delete a comment
CommentsAPI V2CommentsCommentIdGet Get /v2/comments/{comment_id} Get a comment
CommentsAPI V2CommentsPost Post /v2/comments Create a comment
EntriesAPI V2ListsListEntriesEntryIdAttributesAttributeValuesGet Get /v2/lists/{list}/entries/{entry_id}/attributes/{attribute}/values List attribute values for a list entry
EntriesAPI V2ListsListEntriesEntryIdDelete Delete /v2/lists/{list}/entries/{entry_id} Delete a list entry
EntriesAPI V2ListsListEntriesEntryIdGet Get /v2/lists/{list}/entries/{entry_id} Get a list entry
EntriesAPI V2ListsListEntriesEntryIdPatch Patch /v2/lists/{list}/entries/{entry_id} Update a list entry (append multiselect values)
EntriesAPI V2ListsListEntriesEntryIdPut Put /v2/lists/{list}/entries/{entry_id} Update a list entry (overwrite multiselect values)
EntriesAPI V2ListsListEntriesPost Post /v2/lists/{list}/entries Create an entry (add record to list)
EntriesAPI V2ListsListEntriesPut Put /v2/lists/{list}/entries Assert a list entry by parent
EntriesAPI V2ListsListEntriesQueryPost Post /v2/lists/{list}/entries/query List entries
ListsAPI V2ListsGet Get /v2/lists List all lists
ListsAPI V2ListsListGet Get /v2/lists/{list} Get a list
ListsAPI V2ListsListPatch Patch /v2/lists/{list} Update a list
ListsAPI V2ListsPost Post /v2/lists Create a list
MeetingsAPI V2MeetingsGet Get /v2/meetings List meetings
MeetingsAPI V2MeetingsMeetingIdGet Get /v2/meetings/{meeting_id} Get a meeting
MeetingsAPI V2MeetingsPost Post /v2/meetings Find or create a meeting
MetaAPI V2SelfGet Get /v2/self Identify
NotesAPI V2NotesGet Get /v2/notes List notes
NotesAPI V2NotesNoteIdDelete Delete /v2/notes/{note_id} Delete a note
NotesAPI V2NotesNoteIdGet Get /v2/notes/{note_id} Get a note
NotesAPI V2NotesPost Post /v2/notes Create a note
ObjectsAPI V2ObjectsGet Get /v2/objects List objects
ObjectsAPI V2ObjectsObjectGet Get /v2/objects/{object} Get an object
ObjectsAPI V2ObjectsObjectPatch Patch /v2/objects/{object} Update an object
ObjectsAPI V2ObjectsPost Post /v2/objects Create an object
RecordsAPI V2ObjectsObjectRecordsPost Post /v2/objects/{object}/records Create a record
RecordsAPI V2ObjectsObjectRecordsPut Put /v2/objects/{object}/records Assert a record
RecordsAPI V2ObjectsObjectRecordsQueryPost Post /v2/objects/{object}/records/query List records
RecordsAPI V2ObjectsObjectRecordsRecordIdAttributesAttributeValuesGet Get /v2/objects/{object}/records/{record_id}/attributes/{attribute}/values List record attribute values
RecordsAPI V2ObjectsObjectRecordsRecordIdDelete Delete /v2/objects/{object}/records/{record_id} Delete a record
RecordsAPI V2ObjectsObjectRecordsRecordIdEntriesGet Get /v2/objects/{object}/records/{record_id}/entries List record entries
RecordsAPI V2ObjectsObjectRecordsRecordIdGet Get /v2/objects/{object}/records/{record_id} Get a record
RecordsAPI V2ObjectsObjectRecordsRecordIdPatch Patch /v2/objects/{object}/records/{record_id} Update a record (append multiselect values)
RecordsAPI V2ObjectsObjectRecordsRecordIdPut Put /v2/objects/{object}/records/{record_id} Update a record (overwrite multiselect values)
RecordsAPI V2ObjectsRecordsSearchPost Post /v2/objects/records/search Search records
TasksAPI V2TasksGet Get /v2/tasks List tasks
TasksAPI V2TasksPost Post /v2/tasks Create a task
TasksAPI V2TasksTaskIdDelete Delete /v2/tasks/{task_id} Delete a task
TasksAPI V2TasksTaskIdGet Get /v2/tasks/{task_id} Get a task
TasksAPI V2TasksTaskIdPatch Patch /v2/tasks/{task_id} Update a task
ThreadsAPI V2ThreadsGet Get /v2/threads List threads
ThreadsAPI V2ThreadsThreadIdGet Get /v2/threads/{thread_id} Get a thread
TranscriptsAPI V2MeetingsMeetingIdCallRecordingsCallRecordingIdTranscriptGet Get /v2/meetings/{meeting_id}/call_recordings/{call_recording_id}/transcript Get call transcript
WebhooksAPI V2WebhooksGet Get /v2/webhooks List webhooks
WebhooksAPI V2WebhooksPost Post /v2/webhooks Create a webhook
WebhooksAPI V2WebhooksWebhookIdDelete Delete /v2/webhooks/{webhook_id} Delete a webhook
WebhooksAPI V2WebhooksWebhookIdGet Get /v2/webhooks/{webhook_id} Get a webhook
WebhooksAPI V2WebhooksWebhookIdPatch Patch /v2/webhooks/{webhook_id} Update a webhook
WorkspaceMembersAPI V2WorkspaceMembersGet Get /v2/workspace_members List workspace members
WorkspaceMembersAPI V2WorkspaceMembersWorkspaceMemberIdGet Get /v2/workspace_members/{workspace_member_id} Get a workspace member

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

oauth2

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: https://app.attio.com/authorize
  • Scopes:
  • user_management:read: View workspace members.
  • user_management:read-write: View workspace members.
  • record_permission:read: View, and optionally write, records.
  • record_permission:read-write: View, and optionally write, records.
  • object_configuration:read: View, and optionally write, the configuration and attributes of objects.
  • object_configuration:read-write: View, and optionally write, the configuration and attributes of objects.
  • list_entry:read: View, and optionally write, the entries in a list.
  • list_entry:read-write: View, and optionally write, the entries in a list.
  • list_configuration:read: View, and optionally write, the configuration and attributes of lists.
  • list_configuration:read-write: View, and optionally write, the configuration and attributes of lists.
  • public_collection:read: View, and optionally write, both the settings and information within public collections.
  • public_collection:read-write: View, and optionally write, both the settings and information within public collections.
  • private_collection:read: View, and optionally modify, both the settings and information of all collections within the workspace, regardless of their access settings.
  • private_collection:read-write: View, and optionally modify, both the settings and information of all collections within the workspace, regardless of their access settings.
  • comment:read: View comments (and threads), and optionally write comments.
  • comment:read-write: View comments (and threads), and optionally write comments.
  • task:read: View, and optionally write, tasks.
  • task:read-write: View, and optionally write, tasks.
  • note:read: View, and optionally write, notes.
  • note:read-write: View, and optionally write, notes.
  • meeting:read: View, and optionally write, meetings.
  • meeting:read-write: View, and optionally write, meetings.
  • call_recording:read: View, and optionally write, call recordings, transcripts and speakers for meetings.
  • call_recording:read-write: View, and optionally write, call recordings, transcripts and speakers for meetings.
  • webhook:read: View, and optionally manage, webhooks.
  • webhook:read-write: View, and optionally manage, webhooks.

Example

auth := context.WithValue(context.Background(), libattio.ContextAccessToken, "ACCESSTOKENSTRING")
r, err := client.Service.Operation(auth, args)

Or via OAuth2 module to automatically refresh tokens and perform user authentication.

import "golang.org/x/oauth2"

/* Perform OAuth2 round trip request and obtain a token */

tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token)
auth := context.WithValue(oauth2.NoContext, libattio.ContextOAuth2, tokenSource)
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

[email protected]

About

Unofficial Go SDK for the Attio CRM REST API using auto-generated code

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published