openapi

package
v1.23.8 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 3 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://oauth.twilio.com

Class Method HTTP request Description
AuthorizeApi FetchAuthorize Get /v1/authorize
TokenApi CreateToken Post /v1/token

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) CreateToken

func (c *ApiService) CreateToken(params *CreateTokenParams) (*OauthV1Token, error)

Issues a new Access token (optionally identity_token & refresh_token) in exchange of Oauth grant

func (*ApiService) FetchAuthorize added in v1.19.1

func (c *ApiService) FetchAuthorize(params *FetchAuthorizeParams) (*OauthV1Authorize, error)

Retrieves authorize uri

type CreateTokenParams

type CreateTokenParams struct {
	// Grant type is a credential representing resource owner's authorization which can be used by client to obtain access token.
	GrantType *string `json:"GrantType,omitempty"`
	// A 34 character string that uniquely identifies this OAuth App.
	ClientId *string `json:"ClientId,omitempty"`
	// The credential for confidential OAuth App.
	ClientSecret *string `json:"ClientSecret,omitempty"`
	// JWT token related to the authorization code grant type.
	Code *string `json:"Code,omitempty"`
	// The redirect uri
	RedirectUri *string `json:"RedirectUri,omitempty"`
	// The targeted audience uri
	Audience *string `json:"Audience,omitempty"`
	// JWT token related to refresh access token.
	RefreshToken *string `json:"RefreshToken,omitempty"`
	// The scope of token
	Scope *string `json:"Scope,omitempty"`
}

Optional parameters for the method 'CreateToken'

func (*CreateTokenParams) SetAudience added in v1.19.1

func (params *CreateTokenParams) SetAudience(Audience string) *CreateTokenParams

func (*CreateTokenParams) SetClientId added in v1.19.1

func (params *CreateTokenParams) SetClientId(ClientId string) *CreateTokenParams

func (*CreateTokenParams) SetClientSecret

func (params *CreateTokenParams) SetClientSecret(ClientSecret string) *CreateTokenParams

func (*CreateTokenParams) SetCode

func (params *CreateTokenParams) SetCode(Code string) *CreateTokenParams

func (*CreateTokenParams) SetGrantType

func (params *CreateTokenParams) SetGrantType(GrantType string) *CreateTokenParams

func (*CreateTokenParams) SetRedirectUri added in v1.19.1

func (params *CreateTokenParams) SetRedirectUri(RedirectUri string) *CreateTokenParams

func (*CreateTokenParams) SetRefreshToken

func (params *CreateTokenParams) SetRefreshToken(RefreshToken string) *CreateTokenParams

func (*CreateTokenParams) SetScope added in v1.19.1

func (params *CreateTokenParams) SetScope(Scope string) *CreateTokenParams

type FetchAuthorizeParams added in v1.19.1

type FetchAuthorizeParams struct {
	// Response Type
	ResponseType *string `json:"ResponseType,omitempty"`
	// The Client Identifier
	ClientId *string `json:"ClientId,omitempty"`
	// The url to which response will be redirected to
	RedirectUri *string `json:"RedirectUri,omitempty"`
	// The scope of the access request
	Scope *string `json:"Scope,omitempty"`
	// An opaque value which can be used to maintain state between the request and callback
	State *string `json:"State,omitempty"`
}

Optional parameters for the method 'FetchAuthorize'

func (*FetchAuthorizeParams) SetClientId added in v1.19.1

func (params *FetchAuthorizeParams) SetClientId(ClientId string) *FetchAuthorizeParams

func (*FetchAuthorizeParams) SetRedirectUri added in v1.19.1

func (params *FetchAuthorizeParams) SetRedirectUri(RedirectUri string) *FetchAuthorizeParams

func (*FetchAuthorizeParams) SetResponseType added in v1.19.1

func (params *FetchAuthorizeParams) SetResponseType(ResponseType string) *FetchAuthorizeParams

func (*FetchAuthorizeParams) SetScope added in v1.19.1

func (params *FetchAuthorizeParams) SetScope(Scope string) *FetchAuthorizeParams

func (*FetchAuthorizeParams) SetState added in v1.19.1

func (params *FetchAuthorizeParams) SetState(State string) *FetchAuthorizeParams

type OauthV1Authorize added in v1.19.1

type OauthV1Authorize struct {
	// The callback URL
	RedirectTo *string `json:"redirect_to,omitempty"`
}

OauthV1Authorize struct for OauthV1Authorize

type OauthV1Token

type OauthV1Token struct {
	// Token which carries the necessary information to access a Twilio resource directly.
	AccessToken *string `json:"access_token,omitempty"`
	// Token which carries the information necessary to get a new access token.
	RefreshToken *string `json:"refresh_token,omitempty"`
	// Token which carries the information necessary of user profile.
	IdToken *string `json:"id_token,omitempty"`
	// Token type
	TokenType *string `json:"token_type,omitempty"`
	ExpiresIn *int64  `json:"expires_in,omitempty"`
}

OauthV1Token struct for OauthV1Token

Jump to

Keyboard shortcuts

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