openapi

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: MIT Imports: 4 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.43.2
  • 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
CertsApi FetchCerts Get /v1/certs
DeviceCodeApi CreateDeviceCode Post /v1/device/code
TokenApi CreateToken Post /v1/token
UserinfoApi FetchUserInfo Get /v1/userinfo
WellKnownOpenidConfigurationApi FetchOpenidDiscovery Get /v1/.well-known/openid-configuration

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) CreateDeviceCode added in v1.3.0

func (c *ApiService) CreateDeviceCode(params *CreateDeviceCodeParams) (*OauthV1DeviceCode, error)

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

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

func (c *ApiService) FetchCerts() (*OauthV1Certs, error)

Fetches public JWKs

func (*ApiService) FetchOpenidDiscovery

func (c *ApiService) FetchOpenidDiscovery() (*OauthV1OpenidDiscovery, error)

Fetch configuration details about the OpenID Connect Authorization Server

func (*ApiService) FetchUserInfo

func (c *ApiService) FetchUserInfo() (*OauthV1UserInfo, error)

Retrieves the consented UserInfo and other claims about the logged-in subject (end-user).

type CreateDeviceCodeParams added in v1.3.0

type CreateDeviceCodeParams struct {
	// A 34 character string that uniquely identifies this OAuth App.
	ClientSid *string `json:"ClientSid,omitempty"`
	// An Array of scopes for authorization request
	Scopes *[]string `json:"Scopes,omitempty"`
	// An array of intended audiences for token requests
	Audiences *[]string `json:"Audiences,omitempty"`
}

Optional parameters for the method 'CreateDeviceCode'

func (*CreateDeviceCodeParams) SetAudiences added in v1.3.0

func (params *CreateDeviceCodeParams) SetAudiences(Audiences []string) *CreateDeviceCodeParams

func (*CreateDeviceCodeParams) SetClientSid added in v1.3.0

func (params *CreateDeviceCodeParams) SetClientSid(ClientSid string) *CreateDeviceCodeParams

func (*CreateDeviceCodeParams) SetScopes added in v1.3.0

func (params *CreateDeviceCodeParams) SetScopes(Scopes []string) *CreateDeviceCodeParams

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.
	ClientSid *string `json:"ClientSid,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"`
	// A code which is generation cryptographically.
	CodeVerifier *string `json:"CodeVerifier,omitempty"`
	// JWT token related to the device code grant type.
	DeviceCode *string `json:"DeviceCode,omitempty"`
	// JWT token related to the refresh token grant type.
	RefreshToken *string `json:"RefreshToken,omitempty"`
	// The Id of the device associated with the token (refresh token).
	DeviceId *string `json:"DeviceId,omitempty"`
}

Optional parameters for the method 'CreateToken'

func (*CreateTokenParams) SetClientSecret

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

func (*CreateTokenParams) SetClientSid

func (params *CreateTokenParams) SetClientSid(ClientSid string) *CreateTokenParams

func (*CreateTokenParams) SetCode

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

func (*CreateTokenParams) SetCodeVerifier

func (params *CreateTokenParams) SetCodeVerifier(CodeVerifier string) *CreateTokenParams

func (*CreateTokenParams) SetDeviceCode

func (params *CreateTokenParams) SetDeviceCode(DeviceCode string) *CreateTokenParams

func (*CreateTokenParams) SetDeviceId

func (params *CreateTokenParams) SetDeviceId(DeviceId string) *CreateTokenParams

func (*CreateTokenParams) SetGrantType

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

func (*CreateTokenParams) SetRefreshToken

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

type OauthV1Certs

type OauthV1Certs struct {
	// A collection of certificates where are signed Twilio-issued tokens.
	Keys *interface{} `json:"keys,omitempty"`
	Url  *string      `json:"url,omitempty"`
}

OauthV1Certs struct for OauthV1Certs

type OauthV1DeviceCode added in v1.3.0

type OauthV1DeviceCode struct {
	// The device verification code.
	DeviceCode *string `json:"device_code,omitempty"`
	// The verification code which end user uses to verify authorization request.
	UserCode *string `json:"user_code,omitempty"`
	// The URI that the end user visits to verify authorization request.
	VerificationUri *string `json:"verification_uri,omitempty"`
	// The URI with user_code that the end-user alternatively visits to verify authorization request.
	VerificationUriComplete *string `json:"verification_uri_complete,omitempty"`
	// The expiration time of the device_code and user_code in seconds.
	ExpiresIn *int64 `json:"expires_in,omitempty"`
	// The minimum amount of time in seconds that the client should wait between polling requests to the token endpoint.
	Interval *int `json:"interval,omitempty"`
}

OauthV1DeviceCode struct for OauthV1DeviceCode

type OauthV1OpenidDiscovery

type OauthV1OpenidDiscovery struct {
	// The URL of the party that will create the token and sign it with its private key.
	Issuer *string `json:"issuer,omitempty"`
	// The endpoint that validates all authorization requests.
	AuthorizationEndpoint *string `json:"authorization_endpoint,omitempty"`
	// The endpoint that validates all device code related authorization requests.
	DeviceAuthorizationEndpoint *string `json:"device_authorization_endpoint,omitempty"`
	// The URL of the token endpoint. After a client has received an authorization code, that code is presented to the token endpoint and exchanged for an identity token, an access token, and a refresh token.
	TokenEndpoint *string `json:"token_endpoint,omitempty"`
	// The URL of the user info endpoint, which returns user profile information to a client. Keep in mind that the user info endpoint returns only the information that has been requested.
	UserinfoEndpoint *string `json:"userinfo_endpoint,omitempty"`
	// The endpoint used to revoke access or refresh tokens issued by the authorization server.
	RevocationEndpoint *string `json:"revocation_endpoint,omitempty"`
	// The URL of your JSON Web Key Set. This set is a collection of JSON Web Keys, a standard method for representing cryptographic keys in a JSON structure.
	JwkUri *string `json:"jwk_uri,omitempty"`
	// A collection of response type supported by authorization server.
	ResponseTypeSupported *[]string `json:"response_type_supported,omitempty"`
	// A collection of subject by authorization server.
	SubjectTypeSupported *[]string `json:"subject_type_supported,omitempty"`
	// A collection of JWS signing algorithms supported by authorization server to sign identity token.
	IdTokenSigningAlgValuesSupported *[]string `json:"id_token_signing_alg_values_supported,omitempty"`
	// A collection of scopes supported by authorization server for identity token
	ScopesSupported *[]string `json:"scopes_supported,omitempty"`
	// A collection of claims supported by authorization server for identity token
	ClaimsSupported *[]string `json:"claims_supported,omitempty"`
	Url             *string   `json:"url,omitempty"`
}

OauthV1OpenidDiscovery struct for OauthV1OpenidDiscovery

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"`
	IdToken      *string `json:"id_token,omitempty"`
	// The date and time in GMT when the refresh token expires in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
	RefreshTokenExpiresAt *time.Time `json:"refresh_token_expires_at,omitempty"`
	// The date and time in GMT when the refresh token expires in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
	AccessTokenExpiresAt *time.Time `json:"access_token_expires_at,omitempty"`
}

OauthV1Token struct for OauthV1Token

type OauthV1UserInfo

type OauthV1UserInfo struct {
	// The URL of the party that will create the token and sign it with its private key.
	UserSid *string `json:"user_sid,omitempty"`
	// The first name of the end-user.
	FirstName *string `json:"first_name,omitempty"`
	// The last name of the end-user.
	LastName *string `json:"last_name,omitempty"`
	// The friendly name of the end-user.
	FriendlyName *string `json:"friendly_name,omitempty"`
	// The end-user's preferred email address.
	Email *string `json:"email,omitempty"`
	Url   *string `json:"url,omitempty"`
}

OauthV1UserInfo struct for OauthV1UserInfo

Jump to

Keyboard shortcuts

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