generated from pulumi/pulumi-tf-provider-boilerplate
/
getInvoices.go
169 lines (147 loc) · 6.21 KB
/
getInvoices.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
// 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 onesubsription
import (
"context"
"reflect"
"github.com/pulumi/pulumi-oci/sdk/go/oci/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// This data source provides the list of Invoices in Oracle Cloud Infrastructure Onesubscription service.
//
// This is a collection API which returns a list of Invoices for given filters.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-oci/sdk/go/oci/OneSubsription"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := OneSubsription.GetInvoices(ctx, &onesubsription.GetInvoicesArgs{
// ArCustomerTransactionId: testArCustomerTransaction.Id,
// CompartmentId: compartmentId,
// Fields: invoiceFields,
// TimeFrom: pulumi.StringRef(invoiceTimeFrom),
// TimeTo: pulumi.StringRef(invoiceTimeTo),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func GetInvoices(ctx *pulumi.Context, args *GetInvoicesArgs, opts ...pulumi.InvokeOption) (*GetInvoicesResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetInvoicesResult
err := ctx.Invoke("oci:OneSubsription/getInvoices:getInvoices", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getInvoices.
type GetInvoicesArgs struct {
// AR Unique identifier for an invoice .
ArCustomerTransactionId string `pulumi:"arCustomerTransactionId"`
// The OCID of the root compartment.
CompartmentId string `pulumi:"compartmentId"`
// Partial response refers to an optimization technique offered by the RESTful web APIs to return only the information (fields) required by the client. This parameter is used to control what fields to return.
Fields []string `pulumi:"fields"`
Filters []GetInvoicesFilter `pulumi:"filters"`
// Initial date to filter Invoice data in SPM.
TimeFrom *string `pulumi:"timeFrom"`
// Final date to filter Invoice data in SPM.
TimeTo *string `pulumi:"timeTo"`
}
// A collection of values returned by getInvoices.
type GetInvoicesResult struct {
ArCustomerTransactionId string `pulumi:"arCustomerTransactionId"`
CompartmentId string `pulumi:"compartmentId"`
Fields []string `pulumi:"fields"`
Filters []GetInvoicesFilter `pulumi:"filters"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The list of invoices.
Invoices []GetInvoicesInvoice `pulumi:"invoices"`
TimeFrom *string `pulumi:"timeFrom"`
TimeTo *string `pulumi:"timeTo"`
}
func GetInvoicesOutput(ctx *pulumi.Context, args GetInvoicesOutputArgs, opts ...pulumi.InvokeOption) GetInvoicesResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetInvoicesResult, error) {
args := v.(GetInvoicesArgs)
r, err := GetInvoices(ctx, &args, opts...)
var s GetInvoicesResult
if r != nil {
s = *r
}
return s, err
}).(GetInvoicesResultOutput)
}
// A collection of arguments for invoking getInvoices.
type GetInvoicesOutputArgs struct {
// AR Unique identifier for an invoice .
ArCustomerTransactionId pulumi.StringInput `pulumi:"arCustomerTransactionId"`
// The OCID of the root compartment.
CompartmentId pulumi.StringInput `pulumi:"compartmentId"`
// Partial response refers to an optimization technique offered by the RESTful web APIs to return only the information (fields) required by the client. This parameter is used to control what fields to return.
Fields pulumi.StringArrayInput `pulumi:"fields"`
Filters GetInvoicesFilterArrayInput `pulumi:"filters"`
// Initial date to filter Invoice data in SPM.
TimeFrom pulumi.StringPtrInput `pulumi:"timeFrom"`
// Final date to filter Invoice data in SPM.
TimeTo pulumi.StringPtrInput `pulumi:"timeTo"`
}
func (GetInvoicesOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetInvoicesArgs)(nil)).Elem()
}
// A collection of values returned by getInvoices.
type GetInvoicesResultOutput struct{ *pulumi.OutputState }
func (GetInvoicesResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetInvoicesResult)(nil)).Elem()
}
func (o GetInvoicesResultOutput) ToGetInvoicesResultOutput() GetInvoicesResultOutput {
return o
}
func (o GetInvoicesResultOutput) ToGetInvoicesResultOutputWithContext(ctx context.Context) GetInvoicesResultOutput {
return o
}
func (o GetInvoicesResultOutput) ArCustomerTransactionId() pulumi.StringOutput {
return o.ApplyT(func(v GetInvoicesResult) string { return v.ArCustomerTransactionId }).(pulumi.StringOutput)
}
func (o GetInvoicesResultOutput) CompartmentId() pulumi.StringOutput {
return o.ApplyT(func(v GetInvoicesResult) string { return v.CompartmentId }).(pulumi.StringOutput)
}
func (o GetInvoicesResultOutput) Fields() pulumi.StringArrayOutput {
return o.ApplyT(func(v GetInvoicesResult) []string { return v.Fields }).(pulumi.StringArrayOutput)
}
func (o GetInvoicesResultOutput) Filters() GetInvoicesFilterArrayOutput {
return o.ApplyT(func(v GetInvoicesResult) []GetInvoicesFilter { return v.Filters }).(GetInvoicesFilterArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetInvoicesResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetInvoicesResult) string { return v.Id }).(pulumi.StringOutput)
}
// The list of invoices.
func (o GetInvoicesResultOutput) Invoices() GetInvoicesInvoiceArrayOutput {
return o.ApplyT(func(v GetInvoicesResult) []GetInvoicesInvoice { return v.Invoices }).(GetInvoicesInvoiceArrayOutput)
}
func (o GetInvoicesResultOutput) TimeFrom() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetInvoicesResult) *string { return v.TimeFrom }).(pulumi.StringPtrOutput)
}
func (o GetInvoicesResultOutput) TimeTo() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetInvoicesResult) *string { return v.TimeTo }).(pulumi.StringPtrOutput)
}
func init() {
pulumi.RegisterOutputType(GetInvoicesResultOutput{})
}