openapi

package
v1.23.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 5 Imported by: 0

README

Go API client for openapi

This is the public Twilio REST API.

Overview

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

  • API version: 1.0.0
  • Package version: 1.0.0
  • Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit https://support.twilio.com

Installation

Install the following dependencies:

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

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

import "./openapi"

Documentation for API Endpoints

All URIs are relative to https://iam.twilio.com

Class Method HTTP request Description
KeysApi CreateNewKey Post /v1/Keys
KeysApi DeleteKey Delete /v1/Keys/{Sid}
KeysApi FetchKey Get /v1/Keys/{Sid}
KeysApi ListGetKeys Get /v1/Keys
KeysApi UpdateKey Post /v1/Keys/{Sid}

Documentation For Models

Documentation For Authorization

accountSid_authToken

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
    UserName: "username",
    Password: "password",
})
r, err := client.Service.Operation(auth, args)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiService

type ApiService struct {
	// contains filtered or unexported fields
}

func NewApiService

func NewApiService(requestHandler *twilio.RequestHandler) *ApiService

func NewApiServiceWithClient

func NewApiServiceWithClient(client twilio.BaseClient) *ApiService

func (*ApiService) CreateNewKey

func (c *ApiService) CreateNewKey(params *CreateNewKeyParams) (*IamV1NewKey, error)

Create a new Signing Key for the account making the request.

func (*ApiService) DeleteKey

func (c *ApiService) DeleteKey(Sid string) error

Delete a specific Key.

func (*ApiService) FetchKey

func (c *ApiService) FetchKey(Sid string) (*IamV1Key, error)

Fetch a specific Key.

func (*ApiService) ListGetKeys

func (c *ApiService) ListGetKeys(params *ListGetKeysParams) ([]IamV1GetKeys, error)

Lists GetKeys records from the API as a list. Unlike stream, this operation is eager and loads 'limit' records into memory before returning.

func (*ApiService) PageGetKeys

func (c *ApiService) PageGetKeys(params *ListGetKeysParams, pageToken, pageNumber string) (*ListGetKeysResponse, error)

Retrieve a single page of GetKeys records from the API. Request is executed immediately.

func (*ApiService) StreamGetKeys

func (c *ApiService) StreamGetKeys(params *ListGetKeysParams) (chan IamV1GetKeys, chan error)

Streams GetKeys records from the API as a channel stream. This operation lazily loads records as efficiently as possible until the limit is reached.

func (*ApiService) UpdateKey

func (c *ApiService) UpdateKey(Sid string, params *UpdateKeyParams) (*IamV1Key, error)

Update a specific Key.

type CreateNewKeyParams

type CreateNewKeyParams struct {
	// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource.
	AccountSid *string `json:"AccountSid,omitempty"`
	// A descriptive string that you create to describe the resource. It can be up to 64 characters long.
	FriendlyName *string `json:"FriendlyName,omitempty"`
	//
	KeyType *string `json:"KeyType,omitempty"`
	// The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys).
	Policy *interface{} `json:"Policy,omitempty"`
}

Optional parameters for the method 'CreateNewKey'

func (*CreateNewKeyParams) SetAccountSid

func (params *CreateNewKeyParams) SetAccountSid(AccountSid string) *CreateNewKeyParams

func (*CreateNewKeyParams) SetFriendlyName

func (params *CreateNewKeyParams) SetFriendlyName(FriendlyName string) *CreateNewKeyParams

func (*CreateNewKeyParams) SetKeyType

func (params *CreateNewKeyParams) SetKeyType(KeyType string) *CreateNewKeyParams

func (*CreateNewKeyParams) SetPolicy

func (params *CreateNewKeyParams) SetPolicy(Policy interface{}) *CreateNewKeyParams

type IamV1GetKeys

type IamV1GetKeys struct {
	// The unique string that we created to identify the Key resource.
	Sid *string `json:"sid,omitempty"`
	// The string that you assigned to describe the resource.
	FriendlyName *string `json:"friendly_name,omitempty"`
	// The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
	DateCreated *string `json:"date_created,omitempty"`
	// The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
	DateUpdated *string `json:"date_updated,omitempty"`
}

IamV1GetKeys struct for IamV1GetKeys

type IamV1Key

type IamV1Key struct {
	// The unique string that we created to identify the Key resource.
	Sid *string `json:"sid,omitempty"`
	// The string that you assigned to describe the resource.
	FriendlyName *string `json:"friendly_name,omitempty"`
	// The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
	DateCreated *string `json:"date_created,omitempty"`
	// The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
	DateUpdated *string `json:"date_updated,omitempty"`
	// The \\`Policy\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys).
	Policy *interface{} `json:"policy,omitempty"`
}

IamV1Key struct for IamV1Key

type IamV1NewKey

type IamV1NewKey struct {
	// The unique string that that we created to identify the NewKey resource. You will use this as the basic-auth `user` when authenticating to the API.
	Sid *string `json:"sid,omitempty"`
	// The string that you assigned to describe the resource.
	FriendlyName *string `json:"friendly_name,omitempty"`
	// The date and time in GMT that the API Key was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
	DateCreated *string `json:"date_created,omitempty"`
	// The date and time in GMT that the new API Key was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
	DateUpdated *string `json:"date_updated,omitempty"`
	// The secret your application uses to sign Access Tokens and to authenticate to the REST API (you will use this as the basic-auth `password`).  **Note that for security reasons, this field is ONLY returned when the API Key is first created.**
	Secret *string `json:"secret,omitempty"`
	// Collection of allow assertions.
	Policy *interface{} `json:"policy,omitempty"`
}

IamV1NewKey struct for IamV1NewKey

type ListGetKeysParams

type ListGetKeysParams struct {
	// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource.
	AccountSid *string `json:"AccountSid,omitempty"`
	// How many resources to return in each list page. The default is 50, and the maximum is 1000.
	PageSize *int `json:"PageSize,omitempty"`
	// Max number of records to return.
	Limit *int `json:"limit,omitempty"`
}

Optional parameters for the method 'ListGetKeys'

func (*ListGetKeysParams) SetAccountSid

func (params *ListGetKeysParams) SetAccountSid(AccountSid string) *ListGetKeysParams

func (*ListGetKeysParams) SetLimit

func (params *ListGetKeysParams) SetLimit(Limit int) *ListGetKeysParams

func (*ListGetKeysParams) SetPageSize

func (params *ListGetKeysParams) SetPageSize(PageSize int) *ListGetKeysParams

type ListGetKeysResponse

type ListGetKeysResponse struct {
	Keys []IamV1GetKeys          `json:"keys,omitempty"`
	Meta ListGetKeysResponseMeta `json:"meta,omitempty"`
}

ListGetKeysResponse struct for ListGetKeysResponse

type ListGetKeysResponseMeta

type ListGetKeysResponseMeta struct {
	FirstPageUrl    string  `json:"first_page_url,omitempty"`
	Key             string  `json:"key,omitempty"`
	NextPageUrl     *string `json:"next_page_url,omitempty"`
	Page            int     `json:"page,omitempty"`
	PageSize        int     `json:"page_size,omitempty"`
	PreviousPageUrl *string `json:"previous_page_url,omitempty"`
	Url             string  `json:"url,omitempty"`
}

ListGetKeysResponseMeta struct for ListGetKeysResponseMeta

type UpdateKeyParams

type UpdateKeyParams struct {
	// A descriptive string that you create to describe the resource. It can be up to 64 characters long.
	FriendlyName *string `json:"FriendlyName,omitempty"`
	// The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys).
	Policy *interface{} `json:"Policy,omitempty"`
}

Optional parameters for the method 'UpdateKey'

func (*UpdateKeyParams) SetFriendlyName

func (params *UpdateKeyParams) SetFriendlyName(FriendlyName string) *UpdateKeyParams

func (*UpdateKeyParams) SetPolicy

func (params *UpdateKeyParams) SetPolicy(Policy interface{}) *UpdateKeyParams

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL