-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #227 from recurly/v3-v2021-02-25-12325353567
Generated Latest Changes for v2021-02-25
- Loading branch information
Showing
20 changed files
with
839 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// This file is automatically created by Recurly's OpenAPI generation process | ||
// and thus any edits you make by hand will be lost. If you wish to make a | ||
// change to this file, please create a Github issue explaining the changes you | ||
// need and we will usher them to the appropriate places. | ||
package recurly | ||
|
||
import () | ||
|
||
type AccountExternalSubscription struct { | ||
|
||
// The account code of a new or existing account to be used when creating the external subscription. | ||
AccountCode *string `json:"account_code,omitempty"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
// This file is automatically created by Recurly's OpenAPI generation process | ||
// and thus any edits you make by hand will be lost. If you wish to make a | ||
// change to this file, please create a Github issue explaining the changes you | ||
// need and we will usher them to the appropriate places. | ||
package recurly | ||
|
||
import ( | ||
"context" | ||
"net/http" | ||
) | ||
|
||
type BusinessEntityMini struct { | ||
recurlyResponse *ResponseMetadata | ||
|
||
// Business entity ID | ||
Id string `json:"id,omitempty"` | ||
|
||
// Object type | ||
Object string `json:"object,omitempty"` | ||
|
||
// The entity code of the business entity. | ||
Code string `json:"code,omitempty"` | ||
|
||
// This name describes your business entity and will appear on the invoice. | ||
Name string `json:"name,omitempty"` | ||
} | ||
|
||
// GetResponse returns the ResponseMetadata that generated this resource | ||
func (resource *BusinessEntityMini) GetResponse() *ResponseMetadata { | ||
return resource.recurlyResponse | ||
} | ||
|
||
// setResponse sets the ResponseMetadata that generated this resource | ||
func (resource *BusinessEntityMini) setResponse(res *ResponseMetadata) { | ||
resource.recurlyResponse = res | ||
} | ||
|
||
// internal struct for deserializing accounts | ||
type businessEntityMiniList struct { | ||
ListMetadata | ||
Data []BusinessEntityMini `json:"data"` | ||
recurlyResponse *ResponseMetadata | ||
} | ||
|
||
// GetResponse returns the ResponseMetadata that generated this resource | ||
func (resource *businessEntityMiniList) GetResponse() *ResponseMetadata { | ||
return resource.recurlyResponse | ||
} | ||
|
||
// setResponse sets the ResponseMetadata that generated this resource | ||
func (resource *businessEntityMiniList) setResponse(res *ResponseMetadata) { | ||
resource.recurlyResponse = res | ||
} | ||
|
||
// BusinessEntityMiniList allows you to paginate BusinessEntityMini objects | ||
type BusinessEntityMiniList struct { | ||
client HTTPCaller | ||
requestOptions *RequestOptions | ||
nextPagePath string | ||
hasMore bool | ||
data []BusinessEntityMini | ||
} | ||
|
||
func NewBusinessEntityMiniList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *BusinessEntityMiniList { | ||
return &BusinessEntityMiniList{ | ||
client: client, | ||
requestOptions: requestOptions, | ||
nextPagePath: nextPagePath, | ||
hasMore: true, | ||
} | ||
} | ||
|
||
type BusinessEntityMiniLister interface { | ||
Fetch() error | ||
FetchWithContext(ctx context.Context) error | ||
Count() (*int64, error) | ||
CountWithContext(ctx context.Context) (*int64, error) | ||
Data() []BusinessEntityMini | ||
HasMore() bool | ||
Next() string | ||
} | ||
|
||
func (list *BusinessEntityMiniList) HasMore() bool { | ||
return list.hasMore | ||
} | ||
|
||
func (list *BusinessEntityMiniList) Next() string { | ||
return list.nextPagePath | ||
} | ||
|
||
func (list *BusinessEntityMiniList) Data() []BusinessEntityMini { | ||
return list.data | ||
} | ||
|
||
// Fetch fetches the next page of data into the `Data` property | ||
func (list *BusinessEntityMiniList) FetchWithContext(ctx context.Context) error { | ||
resources := &businessEntityMiniList{} | ||
err := list.client.Call(ctx, http.MethodGet, list.nextPagePath, nil, nil, list.requestOptions, resources) | ||
if err != nil { | ||
return err | ||
} | ||
// copy over properties from the response | ||
list.nextPagePath = resources.Next | ||
list.hasMore = resources.HasMore | ||
list.data = resources.Data | ||
return nil | ||
} | ||
|
||
// Fetch fetches the next page of data into the `Data` property | ||
func (list *BusinessEntityMiniList) Fetch() error { | ||
return list.FetchWithContext(context.Background()) | ||
} | ||
|
||
// Count returns the count of items on the server that match this pager | ||
func (list *BusinessEntityMiniList) CountWithContext(ctx context.Context) (*int64, error) { | ||
resources := &businessEntityMiniList{} | ||
err := list.client.Call(ctx, http.MethodHead, list.nextPagePath, nil, nil, list.requestOptions, resources) | ||
if err != nil { | ||
return nil, err | ||
} | ||
resp := resources.GetResponse() | ||
return resp.TotalRecords, nil | ||
} | ||
|
||
// Count returns the count of items on the server that match this pager | ||
func (list *BusinessEntityMiniList) Count() (*int64, error) { | ||
return list.CountWithContext(context.Background()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// This file is automatically created by Recurly's OpenAPI generation process | ||
// and thus any edits you make by hand will be lost. If you wish to make a | ||
// change to this file, please create a Github issue explaining the changes you | ||
// need and we will usher them to the appropriate places. | ||
package recurly | ||
|
||
import () | ||
|
||
type ExternalProductReferenceConnectionType struct { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// This file is automatically created by Recurly's OpenAPI generation process | ||
// and thus any edits you make by hand will be lost. If you wish to make a | ||
// change to this file, please create a Github issue explaining the changes you | ||
// need and we will usher them to the appropriate places. | ||
package recurly | ||
|
||
import () | ||
|
||
type ExternalProductReferenceUpdate struct { | ||
|
||
// A code which associates the external product to a corresponding object or resource in an external platform like the Apple App Store or Google Play Store. | ||
ReferenceCode *string `json:"reference_code,omitempty"` | ||
|
||
// Represents the connection type. One of the connection types of your enabled App Connectors | ||
ExternalConnectionType *ExternalProductReferenceConnectionType `json:"external_connection_type,omitempty"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// This file is automatically created by Recurly's OpenAPI generation process | ||
// and thus any edits you make by hand will be lost. If you wish to make a | ||
// change to this file, please create a Github issue explaining the changes you | ||
// need and we will usher them to the appropriate places. | ||
package recurly | ||
|
||
import ( | ||
"time" | ||
) | ||
|
||
type ExternalSubscriptionCreate struct { | ||
Account *AccountExternalSubscription `json:"account,omitempty"` | ||
|
||
ExternalProductReference *ExternalProductReferenceCreate `json:"external_product_reference,omitempty"` | ||
|
||
// Id of the subscription in the external system, i.e. Apple App Store or Google Play Store. | ||
ExternalId *string `json:"external_id,omitempty"` | ||
|
||
// When a new billing event occurred on the external subscription in conjunction with a recent billing period, reactivation or upgrade/downgrade. | ||
LastPurchased *time.Time `json:"last_purchased,omitempty"` | ||
|
||
// An indication of whether or not the external subscription will auto-renew at the expiration date. | ||
AutoRenew *bool `json:"auto_renew,omitempty"` | ||
|
||
// External subscriptions can be active, canceled, expired, past_due, voided, revoked, or paused. | ||
State *string `json:"state,omitempty"` | ||
|
||
// Identifier of the app that generated the external subscription. | ||
AppIdentifier *string `json:"app_identifier,omitempty"` | ||
|
||
// An indication of the quantity of a subscribed item's quantity. | ||
Quantity *int `json:"quantity,omitempty"` | ||
|
||
// When the external subscription was activated in the external platform. | ||
ActivatedAt *time.Time `json:"activated_at,omitempty"` | ||
|
||
// When the external subscription expires in the external platform. | ||
ExpiresAt *time.Time `json:"expires_at,omitempty"` | ||
|
||
// When the external subscription trial period started in the external platform. | ||
TrialStartedAt *time.Time `json:"trial_started_at,omitempty"` | ||
|
||
// When the external subscription trial period ends in the external platform. | ||
TrialEndsAt *time.Time `json:"trial_ends_at,omitempty"` | ||
|
||
// An indication of whether or not the external subscription was being created by a historical data import. | ||
Imported *bool `json:"imported,omitempty"` | ||
} |
Oops, something went wrong.