users

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2020 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Overview

Package users contains auto-generated files. DO NOT MODIFY

Package users contains auto-generated files. DO NOT MODIFY

Package users 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 user resources See https://www.twilio.com/docs/chat/rest/user-resource for more details

func New

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

New creates a new instance of the users client

func (Client) Create

func (c Client) Create(input *CreateUserInput) (*CreateUserResponse, error)

Create creates a new user See https://www.twilio.com/docs/chat/rest/user-resource#create-a-user-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 *CreateUserInput) (*CreateUserResponse, error)

CreateWithContext creates a new user See https://www.twilio.com/docs/chat/rest/user-resource#create-a-user-resource for more details

func (*Client) NewUsersPaginator

func (c *Client) NewUsersPaginator() *UsersPaginator

NewUsersPaginator creates a new instance of the paginator for Page.

func (*Client) NewUsersPaginatorWithOptions

func (c *Client) NewUsersPaginatorWithOptions(options *UsersPageOptions) *UsersPaginator

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

func (Client) Page

func (c Client) Page(options *UsersPageOptions) (*UsersPageResponse, error)

Page retrieves a page of users See https://www.twilio.com/docs/chat/rest/user-resource#read-multiple-user-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 *UsersPageOptions) (*UsersPageResponse, error)

PageWithContext retrieves a page of users See https://www.twilio.com/docs/chat/rest/user-resource#read-multiple-user-resources for more details

type ClientProperties

type ClientProperties struct {
	ServiceSid string
}

ClientProperties are the properties required to manage the users resources

type CreateUserInput

type CreateUserInput struct {
	Attributes   *string `form:"Attributes,omitempty"`
	FriendlyName *string `form:"FriendlyName,omitempty"`
	Identity     string  `validate:"required" form:"Identity"`
	RoleSid      *string `form:"RoleSid,omitempty"`
}

CreateUserInput defines the input fields for creating a new user resource

type CreateUserResponse

type CreateUserResponse struct {
	AccountSid          string     `json:"account_sid"`
	Attributes          *string    `json:"attributes,omitempty"`
	DateCreated         time.Time  `json:"date_created"`
	DateUpdated         *time.Time `json:"date_updated,omitempty"`
	FriendlyName        *string    `json:"friendly_name,omitempty"`
	Identity            string     `json:"identity"`
	IsNotifiable        *bool      `json:"is_notifiable,omitempty"`
	IsOnline            *bool      `json:"is_online,omitempty"`
	JoinedChannelsCount *int       `json:"joined_channels_count,omitempty"`
	RoleSid             string     `json:"role_sid"`
	ServiceSid          string     `json:"service_sid"`
	Sid                 string     `json:"sid"`
	URL                 string     `json:"url"`
}

CreateUserResponse defines the response fields for the created user

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 PageUserResponse

type PageUserResponse struct {
	AccountSid          string     `json:"account_sid"`
	Attributes          *string    `json:"attributes,omitempty"`
	DateCreated         time.Time  `json:"date_created"`
	DateUpdated         *time.Time `json:"date_updated,omitempty"`
	FriendlyName        *string    `json:"friendly_name,omitempty"`
	Identity            string     `json:"identity"`
	IsNotifiable        *bool      `json:"is_notifiable,omitempty"`
	IsOnline            *bool      `json:"is_online,omitempty"`
	JoinedChannelsCount *int       `json:"joined_channels_count,omitempty"`
	RoleSid             string     `json:"role_sid"`
	ServiceSid          string     `json:"service_sid"`
	Sid                 string     `json:"sid"`
	URL                 string     `json:"url"`
}

type UsersPage

type UsersPage struct {
	CurrentPage *UsersPageResponse
	Error       error
	// contains filtered or unexported fields
}

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

type UsersPageOptions

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

UsersPageOptions defines the query options for the api operation

type UsersPageResponse

type UsersPageResponse struct {
	Meta  PageMetaResponse   `json:"meta"`
	Users []PageUserResponse `json:"users"`
}

UsersPageResponse defines the response fields for the users page

type UsersPaginator

type UsersPaginator struct {
	Page  *UsersPage
	Users []PageUserResponse
	// contains filtered or unexported fields
}

UsersPaginator defines the fields for makings paginated api calls Users is an array of users that have been returned from all of the page calls

func (*UsersPaginator) CurrentPage

func (p *UsersPaginator) CurrentPage() *UsersPageResponse

CurrentPage retrieves the results for the current page

func (*UsersPaginator) Error

func (p *UsersPaginator) Error() error

Error retrieves the error returned from the page

func (*UsersPaginator) Next

func (p *UsersPaginator) 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 (*UsersPaginator) NextWithContext

func (p *UsersPaginator) 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