-
Notifications
You must be signed in to change notification settings - Fork 80
/
export_image_details.go
66 lines (57 loc) · 1.69 KB
/
export_image_details.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// Core Services API
//
// APIs for Networking Service, Compute Service, and Block Volume Service.
//
package core
import (
"encoding/json"
"github.com/oracle/oci-go-sdk/common"
)
// ExportImageDetails The destination details for the image export.
// Set `destinationType` to `objectStorageTuple`
// and use ExportImageViaObjectStorageTupleDetails
// when specifying the namespace, bucket name, and object name.
// Set `destinationType` to `objectStorageUri` and
// use ExportImageViaObjectStorageUriDetails
// when specifying the Object Storage URL.
type ExportImageDetails interface {
}
type exportimagedetails struct {
JsonData []byte
DestinationType string `json:"destinationType"`
}
// UnmarshalJSON unmarshals json
func (m *exportimagedetails) UnmarshalJSON(data []byte) error {
m.JsonData = data
type Unmarshalerexportimagedetails exportimagedetails
s := struct {
Model Unmarshalerexportimagedetails
}{}
err := json.Unmarshal(data, &s.Model)
if err != nil {
return err
}
m.DestinationType = s.Model.DestinationType
return err
}
// UnmarshalPolymorphicJSON unmarshals polymorphic json
func (m *exportimagedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) {
var err error
switch m.DestinationType {
case "objectStorageUri":
mm := ExportImageViaObjectStorageUriDetails{}
err = json.Unmarshal(data, &mm)
return mm, err
case "objectStorageTuple":
mm := ExportImageViaObjectStorageTupleDetails{}
err = json.Unmarshal(data, &mm)
return mm, err
default:
return m, nil
}
}
func (m exportimagedetails) String() string {
return common.PointerString(m)
}