Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto PR: Regenerating the Go SDK (851b7ea0fd445f15eaded7bd7a8796d17fa409b9) #1069

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,14 @@ func unmarshalDatasetImplementation(input []byte) (Dataset, error) {
return out, nil
}

if strings.EqualFold(value, "Iceberg") {
var out IcebergDataset
if err := json.Unmarshal(input, &out); err != nil {
return nil, fmt.Errorf("unmarshaling into IcebergDataset: %+v", err)
}
return out, nil
}

if strings.EqualFold(value, "ImpalaObject") {
var out ImpalaObjectDataset
if err := json.Unmarshal(input, &out); err != nil {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package datasets

import (
"encoding/json"
"fmt"
)

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.

var _ Dataset = IcebergDataset{}

type IcebergDataset struct {
TypeProperties *IcebergDatasetTypeProperties `json:"typeProperties,omitempty"`

// Fields inherited from Dataset
Annotations *[]interface{} `json:"annotations,omitempty"`
Description *string `json:"description,omitempty"`
Folder *DatasetFolder `json:"folder,omitempty"`
LinkedServiceName LinkedServiceReference `json:"linkedServiceName"`
Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"`
Schema *interface{} `json:"schema,omitempty"`
Structure *interface{} `json:"structure,omitempty"`
}

var _ json.Marshaler = IcebergDataset{}

func (s IcebergDataset) MarshalJSON() ([]byte, error) {
type wrapper IcebergDataset
wrapped := wrapper(s)
encoded, err := json.Marshal(wrapped)
if err != nil {
return nil, fmt.Errorf("marshaling IcebergDataset: %+v", err)
}

var decoded map[string]interface{}
if err := json.Unmarshal(encoded, &decoded); err != nil {
return nil, fmt.Errorf("unmarshaling IcebergDataset: %+v", err)
}
decoded["type"] = "Iceberg"

encoded, err = json.Marshal(decoded)
if err != nil {
return nil, fmt.Errorf("re-marshaling IcebergDataset: %+v", err)
}

return encoded, nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package datasets

import (
"encoding/json"
"fmt"
)

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.

type IcebergDatasetTypeProperties struct {
Location DatasetLocation `json:"location"`
}

var _ json.Unmarshaler = &IcebergDatasetTypeProperties{}

func (s *IcebergDatasetTypeProperties) UnmarshalJSON(bytes []byte) error {

var temp map[string]json.RawMessage
if err := json.Unmarshal(bytes, &temp); err != nil {
return fmt.Errorf("unmarshaling IcebergDatasetTypeProperties into map[string]json.RawMessage: %+v", err)
}

if v, ok := temp["location"]; ok {
impl, err := unmarshalDatasetLocationImplementation(v)
if err != nil {
return fmt.Errorf("unmarshaling field 'Location' for 'IcebergDatasetTypeProperties': %+v", err)
}
s.Location = impl
}
return nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,14 @@ func unmarshalCopySinkImplementation(input []byte) (CopySink, error) {
return out, nil
}

if strings.EqualFold(value, "IcebergSink") {
var out IcebergSink
if err := json.Unmarshal(input, &out); err != nil {
return nil, fmt.Errorf("unmarshaling into IcebergSink: %+v", err)
}
return out, nil
}

if strings.EqualFold(value, "InformixSink") {
var out InformixSink
if err := json.Unmarshal(input, &out); err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ func unmarshalFormatWriteSettingsImplementation(input []byte) (FormatWriteSettin
return out, nil
}

if strings.EqualFold(value, "IcebergWriteSettings") {
var out IcebergWriteSettings
if err := json.Unmarshal(input, &out); err != nil {
return nil, fmt.Errorf("unmarshaling into IcebergWriteSettings: %+v", err)
}
return out, nil
}

if strings.EqualFold(value, "JsonWriteSettings") {
var out JsonWriteSettings
if err := json.Unmarshal(input, &out); err != nil {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
package pipelines

import (
"encoding/json"
"fmt"
)

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.

var _ CopySink = IcebergSink{}

type IcebergSink struct {
FormatSettings FormatWriteSettings `json:"formatSettings"`
StoreSettings StoreWriteSettings `json:"storeSettings"`

// Fields inherited from CopySink
DisableMetricsCollection *bool `json:"disableMetricsCollection,omitempty"`
MaxConcurrentConnections *int64 `json:"maxConcurrentConnections,omitempty"`
SinkRetryCount *int64 `json:"sinkRetryCount,omitempty"`
SinkRetryWait *string `json:"sinkRetryWait,omitempty"`
WriteBatchSize *int64 `json:"writeBatchSize,omitempty"`
WriteBatchTimeout *string `json:"writeBatchTimeout,omitempty"`
}

var _ json.Marshaler = IcebergSink{}

func (s IcebergSink) MarshalJSON() ([]byte, error) {
type wrapper IcebergSink
wrapped := wrapper(s)
encoded, err := json.Marshal(wrapped)
if err != nil {
return nil, fmt.Errorf("marshaling IcebergSink: %+v", err)
}

var decoded map[string]interface{}
if err := json.Unmarshal(encoded, &decoded); err != nil {
return nil, fmt.Errorf("unmarshaling IcebergSink: %+v", err)
}
decoded["type"] = "IcebergSink"

encoded, err = json.Marshal(decoded)
if err != nil {
return nil, fmt.Errorf("re-marshaling IcebergSink: %+v", err)
}

return encoded, nil
}

var _ json.Unmarshaler = &IcebergSink{}

func (s *IcebergSink) UnmarshalJSON(bytes []byte) error {
type alias IcebergSink
var decoded alias
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling into IcebergSink: %+v", err)
}

s.DisableMetricsCollection = decoded.DisableMetricsCollection
s.MaxConcurrentConnections = decoded.MaxConcurrentConnections
s.SinkRetryCount = decoded.SinkRetryCount
s.SinkRetryWait = decoded.SinkRetryWait
s.WriteBatchSize = decoded.WriteBatchSize
s.WriteBatchTimeout = decoded.WriteBatchTimeout

var temp map[string]json.RawMessage
if err := json.Unmarshal(bytes, &temp); err != nil {
return fmt.Errorf("unmarshaling IcebergSink into map[string]json.RawMessage: %+v", err)
}

if v, ok := temp["formatSettings"]; ok {
impl, err := unmarshalFormatWriteSettingsImplementation(v)
if err != nil {
return fmt.Errorf("unmarshaling field 'FormatSettings' for 'IcebergSink': %+v", err)
}
s.FormatSettings = impl
}

if v, ok := temp["storeSettings"]; ok {
impl, err := unmarshalStoreWriteSettingsImplementation(v)
if err != nil {
return fmt.Errorf("unmarshaling field 'StoreSettings' for 'IcebergSink': %+v", err)
}
s.StoreSettings = impl
}
return nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package pipelines

import (
"encoding/json"
"fmt"
)

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.

var _ FormatWriteSettings = IcebergWriteSettings{}

type IcebergWriteSettings struct {

// Fields inherited from FormatWriteSettings
}

var _ json.Marshaler = IcebergWriteSettings{}

func (s IcebergWriteSettings) MarshalJSON() ([]byte, error) {
type wrapper IcebergWriteSettings
wrapped := wrapper(s)
encoded, err := json.Marshal(wrapped)
if err != nil {
return nil, fmt.Errorf("marshaling IcebergWriteSettings: %+v", err)
}

var decoded map[string]interface{}
if err := json.Unmarshal(encoded, &decoded); err != nil {
return nil, fmt.Errorf("unmarshaling IcebergWriteSettings: %+v", err)
}
decoded["type"] = "IcebergWriteSettings"

encoded, err = json.Marshal(decoded)
if err != nil {
return nil, fmt.Errorf("re-marshaling IcebergWriteSettings: %+v", err)
}

return encoded, nil
}

This file was deleted.

This file was deleted.

Loading
Loading