generated from pulumi/pulumi-tf-provider-boilerplate
/
getProducts.go
182 lines (156 loc) · 7.28 KB
/
getProducts.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
// 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 marketplace
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// This data source provides the Market product items of Alibaba Cloud.
//
// > **NOTE:** Available in 1.64.0+
func GetProducts(ctx *pulumi.Context, args *GetProductsArgs, opts ...pulumi.InvokeOption) (*GetProductsResult, error) {
opts = pkgInvokeDefaultOpts(opts)
var rv GetProductsResult
err := ctx.Invoke("alicloud:marketplace/getProducts:getProducts", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getProducts.
type GetProductsArgs struct {
// The Category ID of products. For more information, see [DescribeProducts](https://help.aliyun.com/document_detail/89834.htm).
CategoryId *string `pulumi:"categoryId"`
// A list of product code.
Ids []string `pulumi:"ids"`
// A regex string to apply to the product name.
NameRegex *string `pulumi:"nameRegex"`
OutputFile *string `pulumi:"outputFile"`
// The type of products, Valid values: `APP`, `SERVICE`, `MIRROR`, `DOWNLOAD` and `API_SERVICE`.
ProductType *string `pulumi:"productType"`
// Search term in this query.
SearchTerm *string `pulumi:"searchTerm"`
// This field determines how to sort the filtered results, Valid values: `user_count-desc`, `created_on-desc`, `price-desc` and `score-desc`.
Sort *string `pulumi:"sort"`
// The suggested price of the product.
SuggestedPrice *float64 `pulumi:"suggestedPrice"`
// The supplier id of the product.
SupplierId *string `pulumi:"supplierId"`
// The supplier name keyword of the product.
SupplierNameKeyword *string `pulumi:"supplierNameKeyword"`
}
// A collection of values returned by getProducts.
type GetProductsResult struct {
// The category id of the product.
CategoryId *string `pulumi:"categoryId"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// A list of product codes.
Ids []string `pulumi:"ids"`
NameRegex *string `pulumi:"nameRegex"`
OutputFile *string `pulumi:"outputFile"`
ProductType *string `pulumi:"productType"`
// A list of products. Each element contains the following attributes:
Products []GetProductsProduct `pulumi:"products"`
SearchTerm *string `pulumi:"searchTerm"`
Sort *string `pulumi:"sort"`
// The suggested price of the product.
SuggestedPrice *float64 `pulumi:"suggestedPrice"`
// The supplier id of the product.
SupplierId *string `pulumi:"supplierId"`
SupplierNameKeyword *string `pulumi:"supplierNameKeyword"`
}
func GetProductsOutput(ctx *pulumi.Context, args GetProductsOutputArgs, opts ...pulumi.InvokeOption) GetProductsResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetProductsResult, error) {
args := v.(GetProductsArgs)
r, err := GetProducts(ctx, &args, opts...)
var s GetProductsResult
if r != nil {
s = *r
}
return s, err
}).(GetProductsResultOutput)
}
// A collection of arguments for invoking getProducts.
type GetProductsOutputArgs struct {
// The Category ID of products. For more information, see [DescribeProducts](https://help.aliyun.com/document_detail/89834.htm).
CategoryId pulumi.StringPtrInput `pulumi:"categoryId"`
// A list of product code.
Ids pulumi.StringArrayInput `pulumi:"ids"`
// A regex string to apply to the product name.
NameRegex pulumi.StringPtrInput `pulumi:"nameRegex"`
OutputFile pulumi.StringPtrInput `pulumi:"outputFile"`
// The type of products, Valid values: `APP`, `SERVICE`, `MIRROR`, `DOWNLOAD` and `API_SERVICE`.
ProductType pulumi.StringPtrInput `pulumi:"productType"`
// Search term in this query.
SearchTerm pulumi.StringPtrInput `pulumi:"searchTerm"`
// This field determines how to sort the filtered results, Valid values: `user_count-desc`, `created_on-desc`, `price-desc` and `score-desc`.
Sort pulumi.StringPtrInput `pulumi:"sort"`
// The suggested price of the product.
SuggestedPrice pulumi.Float64PtrInput `pulumi:"suggestedPrice"`
// The supplier id of the product.
SupplierId pulumi.StringPtrInput `pulumi:"supplierId"`
// The supplier name keyword of the product.
SupplierNameKeyword pulumi.StringPtrInput `pulumi:"supplierNameKeyword"`
}
func (GetProductsOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetProductsArgs)(nil)).Elem()
}
// A collection of values returned by getProducts.
type GetProductsResultOutput struct{ *pulumi.OutputState }
func (GetProductsResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetProductsResult)(nil)).Elem()
}
func (o GetProductsResultOutput) ToGetProductsResultOutput() GetProductsResultOutput {
return o
}
func (o GetProductsResultOutput) ToGetProductsResultOutputWithContext(ctx context.Context) GetProductsResultOutput {
return o
}
// The category id of the product.
func (o GetProductsResultOutput) CategoryId() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetProductsResult) *string { return v.CategoryId }).(pulumi.StringPtrOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetProductsResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetProductsResult) string { return v.Id }).(pulumi.StringOutput)
}
// A list of product codes.
func (o GetProductsResultOutput) Ids() pulumi.StringArrayOutput {
return o.ApplyT(func(v GetProductsResult) []string { return v.Ids }).(pulumi.StringArrayOutput)
}
func (o GetProductsResultOutput) NameRegex() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetProductsResult) *string { return v.NameRegex }).(pulumi.StringPtrOutput)
}
func (o GetProductsResultOutput) OutputFile() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetProductsResult) *string { return v.OutputFile }).(pulumi.StringPtrOutput)
}
func (o GetProductsResultOutput) ProductType() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetProductsResult) *string { return v.ProductType }).(pulumi.StringPtrOutput)
}
// A list of products. Each element contains the following attributes:
func (o GetProductsResultOutput) Products() GetProductsProductArrayOutput {
return o.ApplyT(func(v GetProductsResult) []GetProductsProduct { return v.Products }).(GetProductsProductArrayOutput)
}
func (o GetProductsResultOutput) SearchTerm() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetProductsResult) *string { return v.SearchTerm }).(pulumi.StringPtrOutput)
}
func (o GetProductsResultOutput) Sort() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetProductsResult) *string { return v.Sort }).(pulumi.StringPtrOutput)
}
// The suggested price of the product.
func (o GetProductsResultOutput) SuggestedPrice() pulumi.Float64PtrOutput {
return o.ApplyT(func(v GetProductsResult) *float64 { return v.SuggestedPrice }).(pulumi.Float64PtrOutput)
}
// The supplier id of the product.
func (o GetProductsResultOutput) SupplierId() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetProductsResult) *string { return v.SupplierId }).(pulumi.StringPtrOutput)
}
func (o GetProductsResultOutput) SupplierNameKeyword() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetProductsResult) *string { return v.SupplierNameKeyword }).(pulumi.StringPtrOutput)
}
func init() {
pulumi.RegisterOutputType(GetProductsResultOutput{})
}