Help us shape the future of Go! Take the 2026 Go Developer Survey

httpcallv2

package
v0.167.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Lorem Ipsum

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComplexQueryParam

type ComplexQueryParam struct {
	NestedOptionalQueryParam string `json:"nested_optional_query_param,omitempty" url:"nested_optional_query_param,omitempty"`

	NestedRepeatedQueryParam []string `json:"nested_repeated_query_param,omitempty" url:"nested_repeated_query_param,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

func (ComplexQueryParam) MarshalJSON

func (s ComplexQueryParam) MarshalJSON() ([]byte, error)

func (*ComplexQueryParam) UnmarshalJSON

func (s *ComplexQueryParam) UnmarshalJSON(b []byte) error

type CreateResourceRequest

type CreateResourceRequest struct {
	// Body element
	BodyField string `json:"body_field,omitempty"`

	PathParamBool bool `json:"-" url:"-"`

	PathParamInt int `json:"-" url:"-"`

	PathParamString string `json:"-" url:"-"`

	ForceSendFields []string `json:"-" url:"-"`
}

This mimics "old" style post requests which have the resource inlined.

func (CreateResourceRequest) MarshalJSON

func (s CreateResourceRequest) MarshalJSON() ([]byte, error)

func (*CreateResourceRequest) UnmarshalJSON

func (s *CreateResourceRequest) UnmarshalJSON(b []byte) error

type GetResourceRequest

type GetResourceRequest struct {
	// The field mask must be a single string, with multiple fields separated by
	// commas (no spaces). The field path is relative to the resource object,
	// using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`).
	// Specification of elements in sequence or map fields is not allowed, as
	// only the entire collection field can be specified. Field names must
	// exactly match the resource field names.
	FieldMask *fieldmask.FieldMask `json:"-" url:"field_mask,omitempty"`

	OptionalComplexQueryParam *ComplexQueryParam `json:"-" url:"optional_complex_query_param,omitempty"`

	PathParamBool bool `json:"-" url:"-"`

	PathParamInt int `json:"-" url:"-"`

	PathParamString string `json:"-" url:"-"`

	QueryParamBool bool `json:"-" url:"query_param_bool,omitempty"`

	QueryParamInt int `json:"-" url:"query_param_int,omitempty"`

	QueryParamString string `json:"-" url:"query_param_string,omitempty"`

	RepeatedComplexQueryParam []ComplexQueryParam `json:"-" url:"repeated_complex_query_param,omitempty"`

	RepeatedQueryParam []string `json:"-" url:"repeated_query_param,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

func (GetResourceRequest) MarshalJSON

func (s GetResourceRequest) MarshalJSON() ([]byte, error)

func (*GetResourceRequest) UnmarshalJSON

func (s *GetResourceRequest) UnmarshalJSON(b []byte) error

type HttpCallV2API

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

Lorem Ipsum

func NewHttpCallV2

func NewHttpCallV2(client *client.DatabricksClient) *HttpCallV2API

func (*HttpCallV2API) CreateResource

func (a *HttpCallV2API) CreateResource(ctx context.Context, request CreateResourceRequest) (*Resource, error)

func (*HttpCallV2API) GetResource

func (a *HttpCallV2API) GetResource(ctx context.Context, request GetResourceRequest) (*Resource, error)

func (*HttpCallV2API) SyncResource added in v0.153.0

func (a *HttpCallV2API) SyncResource(ctx context.Context, request SyncResourceRequest) (*Resource, error)

func (*HttpCallV2API) UpdateResource

func (a *HttpCallV2API) UpdateResource(ctx context.Context, request UpdateResourceRequest) (*Resource, error)

type HttpCallV2Interface

type HttpCallV2Interface interface {

	// This mimics "old" style post requests which have the resource inlined.
	//
	// Set the `path_param_string` value before calling. The _resource_ is sent as
	// the request **body**. See the [API overview] for details.
	//
	// Supported body styles:
	//
	// - [inline] - referenced
	//
	// Resolution order:
	//
	// 1. inline body 2. referenced resource
	//
	// [API overview]: https://docs.databricks.com/api
	// [inline]: https://docs.databricks.com/api/inline
	CreateResource(ctx context.Context, request CreateResourceRequest) (*Resource, error)

	GetResource(ctx context.Context, request GetResourceRequest) (*Resource, error)

	// This mimics a parameterless custom method: a body:"*" request whose fields
	// are all path-bound, so the request carries Content-Type: application/json but
	// has no JSON body fields to serialize. The canonical body for such a request
	// is the empty object {}. The :sync verb sits after a literal path segment
	// because Databricks rejects a custom verb placed directly after a path
	// variable as ambiguous.
	SyncResource(ctx context.Context, request SyncResourceRequest) (*Resource, error)

	// This mimics "new" style post requests which have a body field.
	//
	// > Prefer this over the inline form.
	UpdateResource(ctx context.Context, request UpdateResourceRequest) (*Resource, error)
}

type Resource

type Resource struct {
	AnyField json.RawMessage `json:"any_field,omitempty"`

	BodyField string `json:"body_field,omitempty"`

	NestedPathParamBool bool `json:"nested_path_param_bool,omitempty"`

	NestedPathParamInt int `json:"nested_path_param_int,omitempty"`

	NestedPathParamString string `json:"nested_path_param_string,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

func (Resource) MarshalJSON

func (s Resource) MarshalJSON() ([]byte, error)

func (*Resource) UnmarshalJSON

func (s *Resource) UnmarshalJSON(b []byte) error

type SyncResourceRequest added in v0.153.0

type SyncResourceRequest struct {
	// Boolean path segment identifying the resource to sync.
	PathParamBool bool `json:"-" url:"-"`
	// Integer path segment identifying the resource to sync.
	PathParamInt int `json:"-" url:"-"`
	// String path segment identifying the resource to sync.
	PathParamString string `json:"-" url:"-"`
}

This mimics a parameterless custom method's request: all fields are path-bound, so the serialized JSON body is the empty object {}.

type UpdateResourceRequest

type UpdateResourceRequest struct {
	// The field mask must be a single string, with multiple fields separated by
	// commas (no spaces). The field path is relative to the resource object,
	// using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`).
	// Specification of elements in sequence or map fields is not allowed, as
	// only the entire collection field can be specified. Field names must
	// exactly match the resource field names.
	FieldMask *fieldmask.FieldMask `json:"-" url:"field_mask,omitempty"`

	NestedPathParamBool bool `json:"-" url:"-"`

	NestedPathParamInt int `json:"-" url:"-"`

	NestedPathParamString string `json:"-" url:"-"`

	OptionalComplexQueryParam *ComplexQueryParam `json:"-" url:"optional_complex_query_param,omitempty"`

	QueryParamBool bool `json:"-" url:"query_param_bool,omitempty"`

	QueryParamInt int `json:"-" url:"query_param_int,omitempty"`

	QueryParamString string `json:"-" url:"query_param_string,omitempty"`

	RepeatedComplexQueryParam []ComplexQueryParam `json:"-" url:"repeated_complex_query_param,omitempty"`

	RepeatedQueryParam []string `json:"-" url:"repeated_query_param,omitempty"`
	// Body element
	Resource Resource `json:"resource"`

	ForceSendFields []string `json:"-" url:"-"`
}

func (UpdateResourceRequest) MarshalJSON

func (s UpdateResourceRequest) MarshalJSON() ([]byte, error)

func (*UpdateResourceRequest) UnmarshalJSON

func (s *UpdateResourceRequest) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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