jsonmarshallv2

package
v0.178.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 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 GetResourceRequest

type GetResourceRequest struct {
	Name string `json:"-" url:"-"`
	// Description.
	Resource Resource `json:"-" url:"resource"`
}

func (*GetResourceRequest) UnmarshalJSON added in v0.174.0

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

type JsonMarshallV2API

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

Lorem Ipsum

func NewJsonMarshallV2

func NewJsonMarshallV2(client *client.DatabricksClient) *JsonMarshallV2API

func (*JsonMarshallV2API) GetResource

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

type JsonMarshallV2Interface

type JsonMarshallV2Interface interface {
	GetResource(ctx context.Context, request GetResourceRequest) (*Resource, error)
}

type NestedMessage

type NestedMessage struct {
	OptionalDuration *duration.Duration `json:"optional_duration,omitempty" url:"optional_duration,omitempty"`

	OptionalString string `json:"optional_string,omitempty" url:"optional_string,omitempty"`

	OptionalTimestamp *time.Time `json:"optional_timestamp,omitempty" url:"optional_timestamp,omitempty"`

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

func (NestedMessage) MarshalJSON

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

func (*NestedMessage) UnmarshalJSON

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

type OptionalFields

type OptionalFields struct {
	Duration *duration.Duration `json:"duration,omitempty" url:"duration,omitempty"`
	// 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:"field_mask,omitempty" url:"field_mask,omitempty"`
	// Legacy Well Known types
	LegacyDuration string `json:"legacy_duration,omitempty" url:"legacy_duration,omitempty"`
	// 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.
	LegacyFieldMask string `json:"legacy_field_mask,omitempty" url:"legacy_field_mask,omitempty"`

	LegacyTimestamp string `json:"legacy_timestamp,omitempty" url:"legacy_timestamp,omitempty"`

	ListValue []json.RawMessage `json:"list_value,omitempty" url:"list_value,omitempty"`
	// Lint disable reason: This is a dummy field used to test SDK Generation
	// logic.
	Map map[string]string `json:"map,omitempty" url:"map,omitempty"`

	OptionalBool bool `json:"optional_bool,omitempty" url:"optional_bool,omitempty"`

	OptionalInt32 int `json:"optional_int32,omitempty" url:"optional_int32,omitempty"`

	OptionalInt64 int64 `json:"optional_int64,omitempty" url:"optional_int64,omitempty"`

	OptionalMessage *NestedMessage `json:"optional_message,omitempty" url:"optional_message,omitempty"`

	OptionalString string `json:"optional_string,omitempty" url:"optional_string,omitempty"`

	Struct map[string]json.RawMessage `json:"struct,omitempty" url:"struct,omitempty"`

	TestEnum TestEnum `json:"test_enum,omitempty" url:"test_enum,omitempty"`

	Timestamp *time.Time `json:"timestamp,omitempty" url:"timestamp,omitempty"`

	Value *json.RawMessage `json:"value,omitempty" url:"value,omitempty"`

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

func (OptionalFields) MarshalJSON

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

func (*OptionalFields) UnmarshalJSON

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

type RepeatedFields

type RepeatedFields struct {
	RepeatedBool []bool `json:"repeated_bool,omitempty" url:"repeated_bool,omitempty"`

	RepeatedDuration []duration.Duration `json:"repeated_duration,omitempty" url:"repeated_duration,omitempty"`

	RepeatedFieldMask []fieldmask.FieldMask `json:"repeated_field_mask,omitempty" url:"repeated_field_mask,omitempty"`

	RepeatedInt32 []int `json:"repeated_int32,omitempty" url:"repeated_int32,omitempty"`

	RepeatedInt64 []int64 `json:"repeated_int64,omitempty" url:"repeated_int64,omitempty"`

	RepeatedListValue [][]json.RawMessage `json:"repeated_list_value,omitempty" url:"repeated_list_value,omitempty"`

	RepeatedMessage []NestedMessage `json:"repeated_message,omitempty" url:"repeated_message,omitempty"`

	RepeatedString []string `json:"repeated_string,omitempty" url:"repeated_string,omitempty"`

	RepeatedStruct []map[string]json.RawMessage `json:"repeated_struct,omitempty" url:"repeated_struct,omitempty"`

	RepeatedTimestamp []time.Time `json:"repeated_timestamp,omitempty" url:"repeated_timestamp,omitempty"`

	RepeatedValue []json.RawMessage `json:"repeated_value,omitempty" url:"repeated_value,omitempty"`

	TestRepeatedEnum []TestEnum `json:"test_repeated_enum,omitempty" url:"test_repeated_enum,omitempty"`
}

func (*RepeatedFields) UnmarshalJSON added in v0.174.0

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

type RequiredFields

type RequiredFields struct {
	RequiredBool bool `json:"required_bool" url:"required_bool"`

	RequiredDuration duration.Duration `json:"required_duration" url:"required_duration"`
	// 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.
	RequiredFieldMask fieldmask.FieldMask `json:"required_field_mask" url:"required_field_mask"`

	RequiredInt32 int `json:"required_int32" url:"required_int32"`

	RequiredInt64 int64 `json:"required_int64" url:"required_int64"`

	RequiredListValue []json.RawMessage `json:"required_list_value" url:"required_list_value"`

	RequiredMessage NestedMessage `json:"required_message" url:"required_message"`

	RequiredString string `json:"required_string" url:"required_string"`

	RequiredStruct map[string]json.RawMessage `json:"required_struct" url:"required_struct"`

	RequiredTimestamp time.Time `json:"required_timestamp" url:"required_timestamp"`

	RequiredValue json.RawMessage `json:"required_value" url:"required_value"`

	TestRequiredEnum TestEnum `json:"test_required_enum" url:"test_required_enum"`
}

func (*RequiredFields) UnmarshalJSON added in v0.174.0

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

type Resource

type Resource struct {
	OptionalFields *OptionalFields `json:"optional_fields,omitempty" url:"optional_fields,omitempty"`

	RepeatedFields *RepeatedFields `json:"repeated_fields,omitempty" url:"repeated_fields,omitempty"`

	RequiredFields *RequiredFields `json:"required_fields,omitempty" url:"required_fields,omitempty"`
}

We separate this into 3 submessages to simplify test cases. E.g., any required top level field needs to be included in the expected json for each test case.

func (*Resource) UnmarshalJSON added in v0.174.0

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

type TestEnum

type TestEnum string
const TestEnumTestEnumOne TestEnum = `TEST_ENUM_ONE`
const TestEnumTestEnumTwo TestEnum = `TEST_ENUM_TWO`

func (*TestEnum) Set

func (f *TestEnum) Set(v string) error

Set raw string value and validate it against allowed values

func (*TestEnum) String

func (f *TestEnum) String() string

String representation for fmt.Print

func (*TestEnum) Type

func (f *TestEnum) Type() string

Type always returns TestEnum to satisfy [pflag.Value] interface

func (*TestEnum) Values

func (f *TestEnum) Values() []TestEnum

Values returns all possible values for TestEnum.

There is no guarantee on the order of the values in the slice.

Jump to

Keyboard shortcuts

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