forked from Azure/azure-sdk-for-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
174 lines (158 loc) · 6.53 KB
/
models.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
package addons
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"encoding/json"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
)
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/addons/mgmt/2018-03-01/addons"
// CanonicalSupportPlanInfoDefinition definition object with the properties of a canonical plan
type CanonicalSupportPlanInfoDefinition struct {
// SupportPlanType - Support plan type. Possible values include: 'SupportPlanTypeEssential', 'SupportPlanTypeStandard', 'SupportPlanTypeAdvanced'
SupportPlanType SupportPlanType `json:"supportPlanType,omitempty"`
// Enabled - Flag to indicate if this support plan type is currently enabled for the subscription.
Enabled *bool `json:"enabled,omitempty"`
// OneTimeCharge - The one time charge status for the subscription. Possible values include: 'No', 'OnEnabled', 'OnReenabled'
OneTimeCharge OneTimeCharge `json:"oneTimeCharge,omitempty"`
}
// CanonicalSupportPlanProperties the properties of the Canonical support plan.
type CanonicalSupportPlanProperties struct {
// ProvisioningState - The provisioning state of the resource. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Purchasing', 'Downgrading', 'Cancelling', 'Upgrading'
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
}
// CanonicalSupportPlanResponseEnvelope the status of the Canonical support plan.
type CanonicalSupportPlanResponseEnvelope struct {
autorest.Response `json:"-"`
// ID - READ-ONLY; The id of the ARM resource, e.g. "/subscriptions/{id}/providers/Microsoft.Addons/supportProvider/{supportProviderName}/supportPlanTypes/{planTypeName}".
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the Canonical support plan, i.e. "essential", "standard" or "advanced".
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Microsoft.Addons/supportProvider
Type *string `json:"type,omitempty"`
// CanonicalSupportPlanProperties - Describes Canonical support plan type and status.
*CanonicalSupportPlanProperties `json:"properties,omitempty"`
}
// MarshalJSON is the custom marshaler for CanonicalSupportPlanResponseEnvelope.
func (cspre CanonicalSupportPlanResponseEnvelope) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if cspre.CanonicalSupportPlanProperties != nil {
objectMap["properties"] = cspre.CanonicalSupportPlanProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for CanonicalSupportPlanResponseEnvelope struct.
func (cspre *CanonicalSupportPlanResponseEnvelope) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
cspre.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
cspre.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
cspre.Type = &typeVar
}
case "properties":
if v != nil {
var canonicalSupportPlanProperties CanonicalSupportPlanProperties
err = json.Unmarshal(*v, &canonicalSupportPlanProperties)
if err != nil {
return err
}
cspre.CanonicalSupportPlanProperties = &canonicalSupportPlanProperties
}
}
}
return nil
}
// ErrorDefinition error description and code explaining why an operation failed.
type ErrorDefinition struct {
// Message - Description of the error.
Message *string `json:"message,omitempty"`
// Code - Service specific error code which serves as the substatus for the HTTP error code.
Code *int32 `json:"code,omitempty"`
}
// ListCanonicalSupportPlanInfoDefinition ...
type ListCanonicalSupportPlanInfoDefinition struct {
autorest.Response `json:"-"`
Value *[]CanonicalSupportPlanInfoDefinition `json:"value,omitempty"`
}
// ListOperationsDefinition ...
type ListOperationsDefinition struct {
autorest.Response `json:"-"`
Value *[]OperationsDefinition `json:"value,omitempty"`
}
// OperationsDefinition definition object with the name and properties of an operation.
type OperationsDefinition struct {
// Name - Name of the operation.
Name *string `json:"name,omitempty"`
// Display - Display object with properties of the operation.
Display *OperationsDisplayDefinition `json:"display,omitempty"`
}
// OperationsDisplayDefinition display object with properties of the operation.
type OperationsDisplayDefinition struct {
// Provider - Resource provider of the operation.
Provider *string `json:"provider,omitempty"`
// Resource - Resource for the operation.
Resource *string `json:"resource,omitempty"`
// Operation - Short description of the operation.
Operation *string `json:"operation,omitempty"`
// Description - Description of the operation.
Description *string `json:"description,omitempty"`
}
// SupportPlanTypesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type SupportPlanTypesCreateOrUpdateFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(SupportPlanTypesClient) (CanonicalSupportPlanResponseEnvelope, error)
}
// SupportPlanTypesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type SupportPlanTypesDeleteFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(SupportPlanTypesClient) (CanonicalSupportPlanResponseEnvelope, error)
}