Product Help

Requests Package Methods and Functions

NewData

func NewData() *Data

NewData creates a new Data instance.

NewDataWithMap

func NewDataWithMap(initialData map[string]interface{}) *Data

NewDataWithMap creates a new data instance with the initial data passed in

ToJson

func (o *Operation) ToJson() ([]byte, error)

ToJson serializes the Operation struct to JSON.

Returns:

  • []byte: The marshaled bytes.

  • error: Any errors from the method.

CreateOperation

func CreateOperation(method string, path string, data *data.Data) Operation

CreateOperation creates a new Operation instance based on the parameters passed in.

Parameters:

  • method: The method for the operation (POST|PATCH|DELETE)

  • path: Path for the operation.

  • data: Data for the operation.

Returns:

  • Operation: The new Operation instance.

CreatePostOperation

func CreatePostOperation(path string, data *data.Data) Operation

CreatePostOperation creates a new operation with POST as its method.

Parameters:

  • path: Path for the operation.

  • data: Data for the operation.

Returns:

  • Operation: The new operation instance.

CreatePatchOperation

func CreatePatchOperation(path string, data *data.Data) Operation

CreatePatchOperation creates a new operation with PATCH as its method.

Parameters:

  • path: Path for the operation.

  • data: Data for the operation.

Returns:

  • Operation: The new operation instance.

CreateDeleteOperation

func CreateDeleteOperation(path string, data *data.Data) Operation

CreateDeleteOperation creates a new operation with DELETE as its method.

Parameters:

  • path: Path for the operation.

  • data: Data for the operation.

Returns:

  • Operation: The new operation instance.

CreatePostUsersOperation

func CreatePostUsersOperation(data *data.Data) Operation

CreatePostUsersOperation creates a new operation with POST as its method and "/Users" as its path.

Parameters:

  • data: Data for the operation.

Returns:

  • Operation: The new operation instance.

CreateDeleteUsersOperation

func CreateDeleteUsersOperation(data *data.Data) Operation

CreateDeleteUsersOperation creates a new operation with DELETE as its method and "/Users" as its path.

Parameters:

  • data: Data for the operation.

Returns:

  • Operation: The new operation instance.

CreateBulkRequest

func CreateBulkRequest(data []operation.Operation) Request

CreateBulkRequest creates a new instance of Request.

Parameters:

  • data: A slice of operations for the request.

Returns:

  • Request: The new request instance.

ToJson

func (r Request) ToJson() ([]byte, error)

ToJson marshals the Request.

Returns:

  • []byte: The marshaled bytes

  • error: Any errors from the method.

Last modified: 28 January 2025