devices

package
v0.0.0-...-dc3cc4a Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

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 devices API

func (*Client) CreateDeviceCode

func (a *Client) CreateDeviceCode(params *CreateDeviceCodeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateDeviceCodeOK, error)
CreateDeviceCode creates device code

Creates a DeviceCode that can be used to login to a Square Terminal device to enter the connected

terminal mode.

func (*Client) GetDeviceCode

func (a *Client) GetDeviceCode(params *GetDeviceCodeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDeviceCodeOK, error)

GetDeviceCode gets device code

Retrieves DeviceCode with the associated ID.

func (*Client) ListDeviceCodes

func (a *Client) ListDeviceCodes(params *ListDeviceCodesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListDeviceCodesOK, error)

ListDeviceCodes lists device codes

Lists all DeviceCodes associated with the merchant.

func (*Client) SetTransport

func (a *Client) SetTransport(transport runtime.ClientTransport)

SetTransport changes the transport on the client

type ClientOption

type ClientOption func(*runtime.ClientOperation)

ClientOption is the option for Client methods

type ClientService

type ClientService interface {
	CreateDeviceCode(params *CreateDeviceCodeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateDeviceCodeOK, error)

	GetDeviceCode(params *GetDeviceCodeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDeviceCodeOK, error)

	ListDeviceCodes(params *ListDeviceCodesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListDeviceCodesOK, error)

	SetTransport(transport runtime.ClientTransport)
}

ClientService is the interface for Client methods

func New

func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService

New creates a new devices API client.

type CreateDeviceCodeOK

type CreateDeviceCodeOK struct {
	Payload *models.CreateDeviceCodeResponse
}
CreateDeviceCodeOK describes a response with status code 200, with default header values.

Success

func NewCreateDeviceCodeOK

func NewCreateDeviceCodeOK() *CreateDeviceCodeOK

NewCreateDeviceCodeOK creates a CreateDeviceCodeOK with default headers values

func (*CreateDeviceCodeOK) Error

func (o *CreateDeviceCodeOK) Error() string

func (*CreateDeviceCodeOK) GetPayload

type CreateDeviceCodeParams

type CreateDeviceCodeParams struct {

	/* Body.

	     An object containing the fields to POST for the request.

	See the corresponding object definition for field details.
	*/
	Body *models.CreateDeviceCodeRequest

	Context    context.Context
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

CreateDeviceCodeParams contains all the parameters to send to the API endpoint

for the create device code operation.

Typically these are written to a http.Request.

func NewCreateDeviceCodeParams

func NewCreateDeviceCodeParams() *CreateDeviceCodeParams

NewCreateDeviceCodeParams creates a new CreateDeviceCodeParams object, with the default timeout for this client.

Default values are not hydrated, since defaults are normally applied by the API server side.

To enforce default values in parameter, use SetDefaults or WithDefaults.

func NewCreateDeviceCodeParamsWithContext

func NewCreateDeviceCodeParamsWithContext(ctx context.Context) *CreateDeviceCodeParams

NewCreateDeviceCodeParamsWithContext creates a new CreateDeviceCodeParams object with the ability to set a context for a request.

func NewCreateDeviceCodeParamsWithHTTPClient

func NewCreateDeviceCodeParamsWithHTTPClient(client *http.Client) *CreateDeviceCodeParams

NewCreateDeviceCodeParamsWithHTTPClient creates a new CreateDeviceCodeParams object with the ability to set a custom HTTPClient for a request.

func NewCreateDeviceCodeParamsWithTimeout

func NewCreateDeviceCodeParamsWithTimeout(timeout time.Duration) *CreateDeviceCodeParams

NewCreateDeviceCodeParamsWithTimeout creates a new CreateDeviceCodeParams object with the ability to set a timeout on a request.

func (*CreateDeviceCodeParams) SetBody

SetBody adds the body to the create device code params

func (*CreateDeviceCodeParams) SetContext

func (o *CreateDeviceCodeParams) SetContext(ctx context.Context)

SetContext adds the context to the create device code params

func (*CreateDeviceCodeParams) SetDefaults

func (o *CreateDeviceCodeParams) SetDefaults()

SetDefaults hydrates default values in the create device code params (not the query body).

All values with no default are reset to their zero value.

func (*CreateDeviceCodeParams) SetHTTPClient

func (o *CreateDeviceCodeParams) SetHTTPClient(client *http.Client)

SetHTTPClient adds the HTTPClient to the create device code params

func (*CreateDeviceCodeParams) SetTimeout

func (o *CreateDeviceCodeParams) SetTimeout(timeout time.Duration)

SetTimeout adds the timeout to the create device code params

func (*CreateDeviceCodeParams) WithBody

WithBody adds the body to the create device code params

func (*CreateDeviceCodeParams) WithContext

WithContext adds the context to the create device code params

func (*CreateDeviceCodeParams) WithDefaults

WithDefaults hydrates default values in the create device code params (not the query body).

All values with no default are reset to their zero value.

func (*CreateDeviceCodeParams) WithHTTPClient

func (o *CreateDeviceCodeParams) WithHTTPClient(client *http.Client) *CreateDeviceCodeParams

WithHTTPClient adds the HTTPClient to the create device code params

func (*CreateDeviceCodeParams) WithTimeout

WithTimeout adds the timeout to the create device code params

func (*CreateDeviceCodeParams) WriteToRequest

WriteToRequest writes these params to a swagger request

type CreateDeviceCodeReader

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

CreateDeviceCodeReader is a Reader for the CreateDeviceCode structure.

func (*CreateDeviceCodeReader) ReadResponse

func (o *CreateDeviceCodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)

ReadResponse reads a server response into the received o.

type GetDeviceCodeOK

type GetDeviceCodeOK struct {
	Payload *models.GetDeviceCodeResponse
}
GetDeviceCodeOK describes a response with status code 200, with default header values.

Success

func NewGetDeviceCodeOK

func NewGetDeviceCodeOK() *GetDeviceCodeOK

NewGetDeviceCodeOK creates a GetDeviceCodeOK with default headers values

func (*GetDeviceCodeOK) Error

func (o *GetDeviceCodeOK) Error() string

func (*GetDeviceCodeOK) GetPayload

func (o *GetDeviceCodeOK) GetPayload() *models.GetDeviceCodeResponse

type GetDeviceCodeParams

type GetDeviceCodeParams struct {

	/* ID.

	   The unique identifier for the device code.
	*/
	ID string

	Context    context.Context
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

GetDeviceCodeParams contains all the parameters to send to the API endpoint

for the get device code operation.

Typically these are written to a http.Request.

func NewGetDeviceCodeParams

func NewGetDeviceCodeParams() *GetDeviceCodeParams

NewGetDeviceCodeParams creates a new GetDeviceCodeParams object, with the default timeout for this client.

Default values are not hydrated, since defaults are normally applied by the API server side.

To enforce default values in parameter, use SetDefaults or WithDefaults.

func NewGetDeviceCodeParamsWithContext

func NewGetDeviceCodeParamsWithContext(ctx context.Context) *GetDeviceCodeParams

NewGetDeviceCodeParamsWithContext creates a new GetDeviceCodeParams object with the ability to set a context for a request.

func NewGetDeviceCodeParamsWithHTTPClient

func NewGetDeviceCodeParamsWithHTTPClient(client *http.Client) *GetDeviceCodeParams

NewGetDeviceCodeParamsWithHTTPClient creates a new GetDeviceCodeParams object with the ability to set a custom HTTPClient for a request.

func NewGetDeviceCodeParamsWithTimeout

func NewGetDeviceCodeParamsWithTimeout(timeout time.Duration) *GetDeviceCodeParams

NewGetDeviceCodeParamsWithTimeout creates a new GetDeviceCodeParams object with the ability to set a timeout on a request.

func (*GetDeviceCodeParams) SetContext

func (o *GetDeviceCodeParams) SetContext(ctx context.Context)

SetContext adds the context to the get device code params

func (*GetDeviceCodeParams) SetDefaults

func (o *GetDeviceCodeParams) SetDefaults()

SetDefaults hydrates default values in the get device code params (not the query body).

All values with no default are reset to their zero value.

func (*GetDeviceCodeParams) SetHTTPClient

func (o *GetDeviceCodeParams) SetHTTPClient(client *http.Client)

SetHTTPClient adds the HTTPClient to the get device code params

func (*GetDeviceCodeParams) SetID

func (o *GetDeviceCodeParams) SetID(id string)

SetID adds the id to the get device code params

func (*GetDeviceCodeParams) SetTimeout

func (o *GetDeviceCodeParams) SetTimeout(timeout time.Duration)

SetTimeout adds the timeout to the get device code params

func (*GetDeviceCodeParams) WithContext

WithContext adds the context to the get device code params

func (*GetDeviceCodeParams) WithDefaults

func (o *GetDeviceCodeParams) WithDefaults() *GetDeviceCodeParams

WithDefaults hydrates default values in the get device code params (not the query body).

All values with no default are reset to their zero value.

func (*GetDeviceCodeParams) WithHTTPClient

func (o *GetDeviceCodeParams) WithHTTPClient(client *http.Client) *GetDeviceCodeParams

WithHTTPClient adds the HTTPClient to the get device code params

func (*GetDeviceCodeParams) WithID

WithID adds the id to the get device code params

func (*GetDeviceCodeParams) WithTimeout

func (o *GetDeviceCodeParams) WithTimeout(timeout time.Duration) *GetDeviceCodeParams

WithTimeout adds the timeout to the get device code params

func (*GetDeviceCodeParams) WriteToRequest

func (o *GetDeviceCodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error

WriteToRequest writes these params to a swagger request

type GetDeviceCodeReader

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

GetDeviceCodeReader is a Reader for the GetDeviceCode structure.

func (*GetDeviceCodeReader) ReadResponse

func (o *GetDeviceCodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)

ReadResponse reads a server response into the received o.

type ListDeviceCodesOK

type ListDeviceCodesOK struct {
	Payload *models.ListDeviceCodesResponse
}
ListDeviceCodesOK describes a response with status code 200, with default header values.

Success

func NewListDeviceCodesOK

func NewListDeviceCodesOK() *ListDeviceCodesOK

NewListDeviceCodesOK creates a ListDeviceCodesOK with default headers values

func (*ListDeviceCodesOK) Error

func (o *ListDeviceCodesOK) Error() string

func (*ListDeviceCodesOK) GetPayload

type ListDeviceCodesParams

type ListDeviceCodesParams struct {

	/* Cursor.

	     A pagination cursor returned by a previous call to this endpoint.
	Provide this to retrieve the next set of results for your original query.

	See [Paginating results](#paginatingresults) for more information.
	*/
	Cursor *string

	/* LocationID.

	     If specified, only returns DeviceCodes of the specified location.
	Returns DeviceCodes of all locations if empty.
	*/
	LocationID *string

	/* ProductType.

	     If specified, only returns DeviceCodes targeting the specified product type.
	Returns DeviceCodes of all product types if empty.
	*/
	ProductType *string

	/* Status.

	     If specified, returns DeviceCodes with the specified statuses.
	Returns DeviceCodes of status `PAIRED` and `UNPAIRED` if empty.
	*/
	Status *string

	Context    context.Context
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

ListDeviceCodesParams contains all the parameters to send to the API endpoint

for the list device codes operation.

Typically these are written to a http.Request.

func NewListDeviceCodesParams

func NewListDeviceCodesParams() *ListDeviceCodesParams

NewListDeviceCodesParams creates a new ListDeviceCodesParams object, with the default timeout for this client.

Default values are not hydrated, since defaults are normally applied by the API server side.

To enforce default values in parameter, use SetDefaults or WithDefaults.

func NewListDeviceCodesParamsWithContext

func NewListDeviceCodesParamsWithContext(ctx context.Context) *ListDeviceCodesParams

NewListDeviceCodesParamsWithContext creates a new ListDeviceCodesParams object with the ability to set a context for a request.

func NewListDeviceCodesParamsWithHTTPClient

func NewListDeviceCodesParamsWithHTTPClient(client *http.Client) *ListDeviceCodesParams

NewListDeviceCodesParamsWithHTTPClient creates a new ListDeviceCodesParams object with the ability to set a custom HTTPClient for a request.

func NewListDeviceCodesParamsWithTimeout

func NewListDeviceCodesParamsWithTimeout(timeout time.Duration) *ListDeviceCodesParams

NewListDeviceCodesParamsWithTimeout creates a new ListDeviceCodesParams object with the ability to set a timeout on a request.

func (*ListDeviceCodesParams) SetContext

func (o *ListDeviceCodesParams) SetContext(ctx context.Context)

SetContext adds the context to the list device codes params

func (*ListDeviceCodesParams) SetCursor

func (o *ListDeviceCodesParams) SetCursor(cursor *string)

SetCursor adds the cursor to the list device codes params

func (*ListDeviceCodesParams) SetDefaults

func (o *ListDeviceCodesParams) SetDefaults()

SetDefaults hydrates default values in the list device codes params (not the query body).

All values with no default are reset to their zero value.

func (*ListDeviceCodesParams) SetHTTPClient

func (o *ListDeviceCodesParams) SetHTTPClient(client *http.Client)

SetHTTPClient adds the HTTPClient to the list device codes params

func (*ListDeviceCodesParams) SetLocationID

func (o *ListDeviceCodesParams) SetLocationID(locationID *string)

SetLocationID adds the locationId to the list device codes params

func (*ListDeviceCodesParams) SetProductType

func (o *ListDeviceCodesParams) SetProductType(productType *string)

SetProductType adds the productType to the list device codes params

func (*ListDeviceCodesParams) SetStatus

func (o *ListDeviceCodesParams) SetStatus(status *string)

SetStatus adds the status to the list device codes params

func (*ListDeviceCodesParams) SetTimeout

func (o *ListDeviceCodesParams) SetTimeout(timeout time.Duration)

SetTimeout adds the timeout to the list device codes params

func (*ListDeviceCodesParams) WithContext

WithContext adds the context to the list device codes params

func (*ListDeviceCodesParams) WithCursor

func (o *ListDeviceCodesParams) WithCursor(cursor *string) *ListDeviceCodesParams

WithCursor adds the cursor to the list device codes params

func (*ListDeviceCodesParams) WithDefaults

func (o *ListDeviceCodesParams) WithDefaults() *ListDeviceCodesParams

WithDefaults hydrates default values in the list device codes params (not the query body).

All values with no default are reset to their zero value.

func (*ListDeviceCodesParams) WithHTTPClient

func (o *ListDeviceCodesParams) WithHTTPClient(client *http.Client) *ListDeviceCodesParams

WithHTTPClient adds the HTTPClient to the list device codes params

func (*ListDeviceCodesParams) WithLocationID

func (o *ListDeviceCodesParams) WithLocationID(locationID *string) *ListDeviceCodesParams

WithLocationID adds the locationID to the list device codes params

func (*ListDeviceCodesParams) WithProductType

func (o *ListDeviceCodesParams) WithProductType(productType *string) *ListDeviceCodesParams

WithProductType adds the productType to the list device codes params

func (*ListDeviceCodesParams) WithStatus

func (o *ListDeviceCodesParams) WithStatus(status *string) *ListDeviceCodesParams

WithStatus adds the status to the list device codes params

func (*ListDeviceCodesParams) WithTimeout

func (o *ListDeviceCodesParams) WithTimeout(timeout time.Duration) *ListDeviceCodesParams

WithTimeout adds the timeout to the list device codes params

func (*ListDeviceCodesParams) WriteToRequest

func (o *ListDeviceCodesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error

WriteToRequest writes these params to a swagger request

type ListDeviceCodesReader

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

ListDeviceCodesReader is a Reader for the ListDeviceCodes structure.

func (*ListDeviceCodesReader) ReadResponse

func (o *ListDeviceCodesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)

ReadResponse reads a server response into the received o.

Jump to

Keyboard shortcuts

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