Requests Package Methods and Functions
NewData
NewData creates a new Data instance.
NewDataWithMap
NewDataWithMap creates a new data instance with the initial data passed in
ToJson
ToJson serializes the Operation struct to JSON.
Returns:
[]byte: The marshaled bytes.
error: Any errors from the method.
CreateOperation
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
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
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
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
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
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
CreateBulkRequest creates a new instance of Request.
Parameters:
data: A slice of operations for the request.
Returns:
Request: The new request instance.
ToJson
ToJson marshals the Request.
Returns:
[]byte: The marshaled bytes
error: Any errors from the method.