/
getCartProductOptionsPlan.go
228 lines (200 loc) · 8.36 KB
/
getCartProductOptionsPlan.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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package order
import (
"context"
"reflect"
"github.com/ovh/pulumi-ovh/sdk/go/ovh/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to retrieve information of order cart product options plan.
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/ovh/pulumi-ovh/sdk/go/ovh/Me"
// "github.com/ovh/pulumi-ovh/sdk/go/ovh/Order"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// myaccount, err := Me.GetMe(ctx, nil, nil)
// if err != nil {
// return err
// }
// mycart, err := Order.GetCart(ctx, &order.GetCartArgs{
// OvhSubsidiary: myaccount.OvhSubsidiary,
// }, nil)
// if err != nil {
// return err
// }
// _, err = Order.GetCartProductOptionsPlan(ctx, &order.GetCartProductOptionsPlanArgs{
// CartId: mycart.Id,
// PriceCapacity: "renew",
// Product: "cloud",
// PlanCode: "project",
// OptionsPlanCode: "vrack",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
func GetCartProductOptionsPlan(ctx *pulumi.Context, args *GetCartProductOptionsPlanArgs, opts ...pulumi.InvokeOption) (*GetCartProductOptionsPlanResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetCartProductOptionsPlanResult
err := ctx.Invoke("ovh:Order/getCartProductOptionsPlan:getCartProductOptionsPlan", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getCartProductOptionsPlan.
type GetCartProductOptionsPlanArgs struct {
// Cart identifier
CartId string `pulumi:"cartId"`
// Catalog name
CatalogName *string `pulumi:"catalogName"`
// options plan code.
OptionsPlanCode string `pulumi:"optionsPlanCode"`
// Product offer identifier
PlanCode string `pulumi:"planCode"`
// Capacity of the pricing (type of pricing)
PriceCapacity string `pulumi:"priceCapacity"`
// Product
Product string `pulumi:"product"`
}
// A collection of values returned by getCartProductOptionsPlan.
type GetCartProductOptionsPlanResult struct {
CartId string `pulumi:"cartId"`
CatalogName *string `pulumi:"catalogName"`
// Define if options of this family are exclusive with each other
Exclusive bool `pulumi:"exclusive"`
// Option family
Family string `pulumi:"family"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// Define if an option of this family is mandatory
Mandatory bool `pulumi:"mandatory"`
OptionsPlanCode string `pulumi:"optionsPlanCode"`
// Product offer identifier
PlanCode string `pulumi:"planCode"`
PriceCapacity string `pulumi:"priceCapacity"`
// Prices of the product offer
Prices []GetCartProductOptionsPlanPrice `pulumi:"prices"`
Product string `pulumi:"product"`
// Name of the product
ProductName string `pulumi:"productName"`
// Product type
ProductType string `pulumi:"productType"`
// Selected Price according to capacity
SelectedPrices []GetCartProductOptionsPlanSelectedPrice `pulumi:"selectedPrices"`
}
func GetCartProductOptionsPlanOutput(ctx *pulumi.Context, args GetCartProductOptionsPlanOutputArgs, opts ...pulumi.InvokeOption) GetCartProductOptionsPlanResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetCartProductOptionsPlanResult, error) {
args := v.(GetCartProductOptionsPlanArgs)
r, err := GetCartProductOptionsPlan(ctx, &args, opts...)
var s GetCartProductOptionsPlanResult
if r != nil {
s = *r
}
return s, err
}).(GetCartProductOptionsPlanResultOutput)
}
// A collection of arguments for invoking getCartProductOptionsPlan.
type GetCartProductOptionsPlanOutputArgs struct {
// Cart identifier
CartId pulumi.StringInput `pulumi:"cartId"`
// Catalog name
CatalogName pulumi.StringPtrInput `pulumi:"catalogName"`
// options plan code.
OptionsPlanCode pulumi.StringInput `pulumi:"optionsPlanCode"`
// Product offer identifier
PlanCode pulumi.StringInput `pulumi:"planCode"`
// Capacity of the pricing (type of pricing)
PriceCapacity pulumi.StringInput `pulumi:"priceCapacity"`
// Product
Product pulumi.StringInput `pulumi:"product"`
}
func (GetCartProductOptionsPlanOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetCartProductOptionsPlanArgs)(nil)).Elem()
}
// A collection of values returned by getCartProductOptionsPlan.
type GetCartProductOptionsPlanResultOutput struct{ *pulumi.OutputState }
func (GetCartProductOptionsPlanResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetCartProductOptionsPlanResult)(nil)).Elem()
}
func (o GetCartProductOptionsPlanResultOutput) ToGetCartProductOptionsPlanResultOutput() GetCartProductOptionsPlanResultOutput {
return o
}
func (o GetCartProductOptionsPlanResultOutput) ToGetCartProductOptionsPlanResultOutputWithContext(ctx context.Context) GetCartProductOptionsPlanResultOutput {
return o
}
func (o GetCartProductOptionsPlanResultOutput) CartId() pulumi.StringOutput {
return o.ApplyT(func(v GetCartProductOptionsPlanResult) string { return v.CartId }).(pulumi.StringOutput)
}
func (o GetCartProductOptionsPlanResultOutput) CatalogName() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetCartProductOptionsPlanResult) *string { return v.CatalogName }).(pulumi.StringPtrOutput)
}
// Define if options of this family are exclusive with each other
func (o GetCartProductOptionsPlanResultOutput) Exclusive() pulumi.BoolOutput {
return o.ApplyT(func(v GetCartProductOptionsPlanResult) bool { return v.Exclusive }).(pulumi.BoolOutput)
}
// Option family
func (o GetCartProductOptionsPlanResultOutput) Family() pulumi.StringOutput {
return o.ApplyT(func(v GetCartProductOptionsPlanResult) string { return v.Family }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetCartProductOptionsPlanResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetCartProductOptionsPlanResult) string { return v.Id }).(pulumi.StringOutput)
}
// Define if an option of this family is mandatory
func (o GetCartProductOptionsPlanResultOutput) Mandatory() pulumi.BoolOutput {
return o.ApplyT(func(v GetCartProductOptionsPlanResult) bool { return v.Mandatory }).(pulumi.BoolOutput)
}
func (o GetCartProductOptionsPlanResultOutput) OptionsPlanCode() pulumi.StringOutput {
return o.ApplyT(func(v GetCartProductOptionsPlanResult) string { return v.OptionsPlanCode }).(pulumi.StringOutput)
}
// Product offer identifier
func (o GetCartProductOptionsPlanResultOutput) PlanCode() pulumi.StringOutput {
return o.ApplyT(func(v GetCartProductOptionsPlanResult) string { return v.PlanCode }).(pulumi.StringOutput)
}
func (o GetCartProductOptionsPlanResultOutput) PriceCapacity() pulumi.StringOutput {
return o.ApplyT(func(v GetCartProductOptionsPlanResult) string { return v.PriceCapacity }).(pulumi.StringOutput)
}
// Prices of the product offer
func (o GetCartProductOptionsPlanResultOutput) Prices() GetCartProductOptionsPlanPriceArrayOutput {
return o.ApplyT(func(v GetCartProductOptionsPlanResult) []GetCartProductOptionsPlanPrice { return v.Prices }).(GetCartProductOptionsPlanPriceArrayOutput)
}
func (o GetCartProductOptionsPlanResultOutput) Product() pulumi.StringOutput {
return o.ApplyT(func(v GetCartProductOptionsPlanResult) string { return v.Product }).(pulumi.StringOutput)
}
// Name of the product
func (o GetCartProductOptionsPlanResultOutput) ProductName() pulumi.StringOutput {
return o.ApplyT(func(v GetCartProductOptionsPlanResult) string { return v.ProductName }).(pulumi.StringOutput)
}
// Product type
func (o GetCartProductOptionsPlanResultOutput) ProductType() pulumi.StringOutput {
return o.ApplyT(func(v GetCartProductOptionsPlanResult) string { return v.ProductType }).(pulumi.StringOutput)
}
// Selected Price according to capacity
func (o GetCartProductOptionsPlanResultOutput) SelectedPrices() GetCartProductOptionsPlanSelectedPriceArrayOutput {
return o.ApplyT(func(v GetCartProductOptionsPlanResult) []GetCartProductOptionsPlanSelectedPrice {
return v.SelectedPrices
}).(GetCartProductOptionsPlanSelectedPriceArrayOutput)
}
func init() {
pulumi.RegisterOutputType(GetCartProductOptionsPlanResultOutput{})
}