roles

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2021 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Overview

Package roles contains auto-generated files. DO NOT MODIFY

Package roles contains auto-generated files. DO NOT MODIFY

Package roles contains auto-generated files. DO NOT MODIFY

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client for managing role resources See https://www.twilio.com/docs/conversations/api/role-resource for more details

func New

func New(client *client.Client, properties ClientProperties) *Client

New creates a new instance of the roles client

func (Client) Create

func (c Client) Create(input *CreateRoleInput) (*CreateRoleResponse, error)

Create creates a new role See https://www.twilio.com/docs/conversations/api/role-resource#create-a-role-resource for more details Context is defaulted to Background. See https://golang.org/pkg/context/#Background for more information

func (Client) CreateWithContext

func (c Client) CreateWithContext(context context.Context, input *CreateRoleInput) (*CreateRoleResponse, error)

CreateWithContext creates a new role See https://www.twilio.com/docs/conversations/api/role-resource#create-a-role-resource for more details

func (*Client) NewRolesPaginator

func (c *Client) NewRolesPaginator() *RolesPaginator

NewRolesPaginator creates a new instance of the paginator for Page.

func (*Client) NewRolesPaginatorWithOptions

func (c *Client) NewRolesPaginatorWithOptions(options *RolesPageOptions) *RolesPaginator

NewRolesPaginatorWithOptions creates a new instance of the paginator for Page with options.

func (Client) Page

func (c Client) Page(options *RolesPageOptions) (*RolesPageResponse, error)

Page retrieves a page of roles See https://www.twilio.com/docs/conversations/api/role-resource#read-multiple-role-resources for more details Context is defaulted to Background. See https://golang.org/pkg/context/#Background for more information

func (Client) PageWithContext

func (c Client) PageWithContext(context context.Context, options *RolesPageOptions) (*RolesPageResponse, error)

PageWithContext retrieves a page of roles See https://www.twilio.com/docs/conversations/api/role-resource#read-multiple-role-resources for more details

type ClientProperties

type ClientProperties struct {
	ServiceSid string
}

ClientProperties are the properties required to manage the roles resources

type CreateRoleInput

type CreateRoleInput struct {
	FriendlyName string   `validate:"required" form:"FriendlyName"`
	Permissions  []string `validate:"required" form:"Permission"`
	Type         string   `validate:"required" form:"Type"`
}

CreateRoleInput defines the input fields for creating a new role resource

type CreateRoleResponse

type CreateRoleResponse struct {
	AccountSid     string     `json:"account_sid"`
	ChatServiceSid string     `json:"chat_service_sid"`
	DateCreated    time.Time  `json:"date_created"`
	DateUpdated    *time.Time `json:"date_updated,omitempty"`
	FriendlyName   string     `json:"friendly_name"`
	Permissions    []string   `json:"permissions"`
	Sid            string     `json:"sid"`
	Type           string     `json:"type"`
	URL            string     `json:"url"`
}

CreateRoleResponse defines the response fields for the created role

type PageMetaResponse

type PageMetaResponse struct {
	FirstPageURL    string  `json:"first_page_url"`
	Key             string  `json:"key"`
	NextPageURL     *string `json:"next_page_url,omitempty"`
	Page            int     `json:"page"`
	PageSize        int     `json:"page_size"`
	PreviousPageURL *string `json:"previous_page_url,omitempty"`
	URL             string  `json:"url"`
}

type PageRoleResponse

type PageRoleResponse struct {
	AccountSid     string     `json:"account_sid"`
	ChatServiceSid string     `json:"chat_service_sid"`
	DateCreated    time.Time  `json:"date_created"`
	DateUpdated    *time.Time `json:"date_updated,omitempty"`
	FriendlyName   string     `json:"friendly_name"`
	Permissions    []string   `json:"permissions"`
	Sid            string     `json:"sid"`
	Type           string     `json:"type"`
	URL            string     `json:"url"`
}

type RolesPage

type RolesPage struct {
	CurrentPage *RolesPageResponse
	Error       error
	// contains filtered or unexported fields
}

RolesPage defines the fields for the page The CurrentPage and Error fields can be used to access the PageRoleResponse or error that is returned from the api call(s)

type RolesPageOptions

type RolesPageOptions struct {
	PageSize  *int
	Page      *int
	PageToken *string
}

RolesPageOptions defines the query options for the api operation

type RolesPageResponse

type RolesPageResponse struct {
	Meta  PageMetaResponse   `json:"meta"`
	Roles []PageRoleResponse `json:"roles"`
}

RolesPageResponse defines the response fields for the roles page

type RolesPaginator

type RolesPaginator struct {
	Page  *RolesPage
	Roles []PageRoleResponse
	// contains filtered or unexported fields
}

RolesPaginator defines the fields for makings paginated api calls Roles is an array of roles that have been returned from all of the page calls

func (*RolesPaginator) CurrentPage

func (p *RolesPaginator) CurrentPage() *RolesPageResponse

CurrentPage retrieves the results for the current page

func (*RolesPaginator) Error

func (p *RolesPaginator) Error() error

Error retrieves the error returned from the page

func (*RolesPaginator) Next

func (p *RolesPaginator) Next() bool

Next retrieves the next page of results. Next will return false when either an error occurs or there are no more pages to iterate Context is defaulted to Background. See https://golang.org/pkg/context/#Background for more information

func (*RolesPaginator) NextWithContext

func (p *RolesPaginator) NextWithContext(context context.Context) bool

NextWithContext retrieves the next page of results. NextWithContext will return false when either an error occurs or there are no more pages to iterate

Jump to

Keyboard shortcuts

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