Skip to content

Commit

Permalink
Update generated code (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
silas authored Mar 12, 2024
1 parent 0e606e4 commit 9334764
Show file tree
Hide file tree
Showing 16 changed files with 209 additions and 22 deletions.
56 changes: 52 additions & 4 deletions adminapi/flows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,19 @@ func TestFlows_CreateJoinOrganization(t *testing.T) {
"updateTime": "2024-02-05T23:07:46.483Z",
"joinOrganization": {
"displayName": "Test",
"email": "[email protected]"
"email": "[email protected]",
"role": {
"id": "string",
"uniqueId": "test",
"displayName": "Test",
"type": "OWNER",
"description": "string",
"permissionSets": [],
"default": true,
"archived": true,
"createTime": "2024-02-05T23:07:46.483Z",
"updateTime": "2024-02-05T23:07:46.483Z"
}
},
"signup": {
"email": "[email protected]",
Expand Down Expand Up @@ -305,7 +317,19 @@ func TestFlows_CreateSignup(t *testing.T) {
"updateTime": "2024-02-05T23:07:46.483Z",
"joinOrganization": {
"displayName": "Test",
"email": "[email protected]"
"email": "[email protected]",
"role": {
"id": "string",
"uniqueId": "test",
"displayName": "Test",
"type": "OWNER",
"description": "string",
"permissionSets": [],
"default": true,
"archived": true,
"createTime": "2024-02-05T23:07:46.483Z",
"updateTime": "2024-02-05T23:07:46.483Z"
}
},
"signup": {
"email": "[email protected]",
Expand Down Expand Up @@ -445,7 +469,19 @@ func TestFlows_Get(t *testing.T) {
"updateTime": "2024-02-05T23:07:46.483Z",
"joinOrganization": {
"displayName": "Test",
"email": "[email protected]"
"email": "[email protected]",
"role": {
"id": "string",
"uniqueId": "test",
"displayName": "Test",
"type": "OWNER",
"description": "string",
"permissionSets": [],
"default": true,
"archived": true,
"createTime": "2024-02-05T23:07:46.483Z",
"updateTime": "2024-02-05T23:07:46.483Z"
}
},
"signup": {
"email": "[email protected]",
Expand Down Expand Up @@ -585,7 +621,19 @@ func TestFlows_Cancel(t *testing.T) {
"updateTime": "2024-02-05T23:07:46.483Z",
"joinOrganization": {
"displayName": "Test",
"email": "[email protected]"
"email": "[email protected]",
"role": {
"id": "string",
"uniqueId": "test",
"displayName": "Test",
"type": "OWNER",
"description": "string",
"permissionSets": [],
"default": true,
"archived": true,
"createTime": "2024-02-05T23:07:46.483Z",
"updateTime": "2024-02-05T23:07:46.483Z"
}
},
"signup": {
"email": "[email protected]",
Expand Down
4 changes: 2 additions & 2 deletions adminapi/invoices_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestInvoices_List(t *testing.T) {
"remainingDueAmount": "string",
"dueTime": "2024-02-05T23:07:46.483Z",
"paidAmount": "string",
"paymentState": "ACTION_REQUIRED",
"paymentState": "PAYMENT_METHOD_REQUIRED",
"pullTime": "2024-02-05T23:07:46.483Z",
"createTime": "2024-02-05T23:07:46.483Z",
"updateTime": "2024-02-05T23:07:46.483Z"
Expand Down Expand Up @@ -145,7 +145,7 @@ func TestInvoices_Get(t *testing.T) {
"remainingDueAmount": "string",
"dueTime": "2024-02-05T23:07:46.483Z",
"paidAmount": "string",
"paymentState": "ACTION_REQUIRED",
"paymentState": "PAYMENT_METHOD_REQUIRED",
"paymentIntent": {
"stripe": {
"accountId": "string",
Expand Down
11 changes: 10 additions & 1 deletion adminapi/subscriptions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,22 @@ func TestSubscriptions_Get(t *testing.T) {
"country": "US"
},
"default": true,
"lastPaymentError": {
"code": "OK",
"message": "string",
"reason": "string",
"param": "string",
"metadata": {}
},
"pullTime": "2024-02-05T23:07:46.483Z",
"createTime": "2024-02-05T23:07:46.483Z",
"updateTime": "2024-02-05T23:07:46.483Z",
"card": {
"brand": "AMERICAN_EXPRESS",
"last4": "string",
"fundingType": "CREDIT"
"fundingType": "CREDIT",
"expYear": 1,
"expMonth": 1
}
},
"cancelPeriodEnd": true,
Expand Down
8 changes: 5 additions & 3 deletions adminv1/card_payment_method.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ package adminv1
type CardPaymentMethod struct {
// The brand of the card (e.g. `VISA`).
Brand string `json:"brand"`
// The expiration date of the card.
Expiration *CardPaymentMethodExpiration `json:"expiration"`
// The last for digits of the card.
Last4 string `json:"last4"`
// The funding method for the card (e.g. `DEBIT`)
// The funding method for the card (e.g. `DEBIT`).
FundingType string `json:"fundingType"`
// The expiration year.
ExpYear int32 `json:"expYear"`
// The expiration month.
ExpMonth int32 `json:"expMonth"`
}
2 changes: 2 additions & 0 deletions adminv1/join_organization_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ type JoinOrganizationFlow struct {
DisplayName string `json:"displayName"`
// The email address of the invitee.
Email string `json:"email"`
// The role to be assigned to the invitee.
Role *Role `json:"role"`
}
6 changes: 6 additions & 0 deletions adminv1/payment_method.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package adminv1
import (
"time"

"github.com/userhubdev/go-sdk/apiv1"
"github.com/userhubdev/go-sdk/commonv1"
)

Expand All @@ -31,6 +32,11 @@ type PaymentMethod struct {
Address *commonv1.Address `json:"address"`
// Whether the payment method is the default for the connected account.
Default bool `json:"default"`
// The last payment error.
//
// This will be unset if the payment method is updated
// or if a payment succeeds.
LastPaymentError *apiv1.Status `json:"lastPaymentError"`
// The last time the payment method was pulled from the connection.
PullTime time.Time `json:"pullTime"`
// The creation time of the payment method connection.
Expand Down
19 changes: 19 additions & 0 deletions adminv1/payment_method_input.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Code generated. DO NOT EDIT.

package adminv1

import (
"github.com/userhubdev/go-sdk/commonv1"
)

// Payment method input parameters.
type PaymentMethodInput struct {
// The full name of the owner of the payment method (e.g. `Jane Doe`).
FullName *string `json:"fullName"`
// The address for the payment method.
Address *commonv1.Address `json:"address"`
// The card expiration year (e.g. `2030`).
ExpYear *int32 `json:"expYear"`
// The card expiration month (e.g. `12`).
ExpMonth *int32 `json:"expMonth"`
}
4 changes: 2 additions & 2 deletions internal/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

const (
ApiBaseUrl = "https://api.userhub.com"
UserAgent = "UserHub-Go/0.4.0"
Version = "0.4.0"
UserAgent = "UserHub-Go/0.5.0"
Version = "0.5.0"

AuthHeader = "Authorization"
ApiKeyHeader = "UserHub-Api-Key"
Expand Down
66 changes: 60 additions & 6 deletions userapi/flows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,16 @@ func TestFlows_CreateJoinOrganization(t *testing.T) {
"createTime": "2024-02-05T23:07:46.483Z",
"joinOrganization": {
"displayName": "Test",
"email": "[email protected]"
"email": "[email protected]",
"role": {
"id": "string",
"uniqueId": "test",
"displayName": "Test",
"type": "OWNER",
"description": "string",
"permissionSets": [],
"default": true
}
},
"signup": {
"email": "[email protected]",
Expand Down Expand Up @@ -145,7 +154,16 @@ func TestFlows_CreateSignup(t *testing.T) {
"createTime": "2024-02-05T23:07:46.483Z",
"joinOrganization": {
"displayName": "Test",
"email": "[email protected]"
"email": "[email protected]",
"role": {
"id": "string",
"uniqueId": "test",
"displayName": "Test",
"type": "OWNER",
"description": "string",
"permissionSets": [],
"default": true
}
},
"signup": {
"email": "[email protected]",
Expand Down Expand Up @@ -207,7 +225,16 @@ func TestFlows_Get(t *testing.T) {
"createTime": "2024-02-05T23:07:46.483Z",
"joinOrganization": {
"displayName": "Test",
"email": "[email protected]"
"email": "[email protected]",
"role": {
"id": "string",
"uniqueId": "test",
"displayName": "Test",
"type": "OWNER",
"description": "string",
"permissionSets": [],
"default": true
}
},
"signup": {
"email": "[email protected]",
Expand Down Expand Up @@ -269,7 +296,16 @@ func TestFlows_Approve(t *testing.T) {
"createTime": "2024-02-05T23:07:46.483Z",
"joinOrganization": {
"displayName": "Test",
"email": "[email protected]"
"email": "[email protected]",
"role": {
"id": "string",
"uniqueId": "test",
"displayName": "Test",
"type": "OWNER",
"description": "string",
"permissionSets": [],
"default": true
}
},
"signup": {
"email": "[email protected]",
Expand Down Expand Up @@ -331,7 +367,16 @@ func TestFlows_Consume(t *testing.T) {
"createTime": "2024-02-05T23:07:46.483Z",
"joinOrganization": {
"displayName": "Test",
"email": "[email protected]"
"email": "[email protected]",
"role": {
"id": "string",
"uniqueId": "test",
"displayName": "Test",
"type": "OWNER",
"description": "string",
"permissionSets": [],
"default": true
}
},
"signup": {
"email": "[email protected]",
Expand Down Expand Up @@ -393,7 +438,16 @@ func TestFlows_Cancel(t *testing.T) {
"createTime": "2024-02-05T23:07:46.483Z",
"joinOrganization": {
"displayName": "Test",
"email": "[email protected]"
"email": "[email protected]",
"role": {
"id": "string",
"uniqueId": "test",
"displayName": "Test",
"type": "OWNER",
"description": "string",
"permissionSets": [],
"default": true
}
},
"signup": {
"email": "[email protected]",
Expand Down
4 changes: 2 additions & 2 deletions userapi/invoices_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestInvoices_List(t *testing.T) {
"remainingDueAmount": "string",
"dueTime": "2024-02-05T23:07:46.483Z",
"paidAmount": "string",
"paymentState": "ACTION_REQUIRED",
"paymentState": "PAYMENT_METHOD_REQUIRED",
"createTime": "2024-02-05T23:07:46.483Z",
"updateTime": "2024-02-05T23:07:46.483Z"
}
Expand Down Expand Up @@ -96,7 +96,7 @@ func TestInvoices_Get(t *testing.T) {
"remainingDueAmount": "string",
"dueTime": "2024-02-05T23:07:46.483Z",
"paidAmount": "string",
"paymentState": "ACTION_REQUIRED",
"paymentState": "PAYMENT_METHOD_REQUIRED",
"paymentIntent": {
"stripe": {
"accountId": "string",
Expand Down
6 changes: 4 additions & 2 deletions userv1/card_payment_method.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ package userv1
type CardPaymentMethod struct {
// The brand of the card (e.g. `VISA`).
Brand string `json:"brand"`
// The expiration date of the card.
Expiration *CardPaymentMethodExpiration `json:"expiration"`
// The expiration year.
ExpYear int32 `json:"expYear"`
// The expiration month.
ExpMonth int32 `json:"expMonth"`
// The last for digits of the card.
Last4 string `json:"last4"`
// The funding method for the card (e.g. `DEBIT`)
Expand Down
2 changes: 2 additions & 0 deletions userv1/join_organization_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ type JoinOrganizationFlow struct {
// This is required if a user isn't provided
// or the user's email address is empty.
Email string `json:"email"`
// The role to be assigned to the invitee.
Role *Role `json:"role"`
}
16 changes: 16 additions & 0 deletions userv1/list_roles_response.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Code generated. DO NOT EDIT.

package userv1

// Response message for ListRoles.
type ListRolesResponse struct {
// The list of roles.
Roles []*Role `json:"roles"`
// A token, which can be sent as `pageToken` to retrieve the next page.
// If this field is omitted, there are no subsequent pages.
NextPageToken string `json:"nextPageToken"`
// A token, which can be sent as `pageToken` to retrieve the previous page.
// If this field is absent, there are no preceding pages. If this field is
// an empty string then the previous page is the first result.
PreviousPageToken string `json:"previousPageToken"`
}
6 changes: 6 additions & 0 deletions userv1/payment_method.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package userv1
import (
"time"

"github.com/userhubdev/go-sdk/apiv1"
"github.com/userhubdev/go-sdk/commonv1"
)

Expand All @@ -25,6 +26,11 @@ type PaymentMethod struct {
Address *commonv1.Address `json:"address"`
// Whether the payment method is the default for the account.
Default bool `json:"default"`
// The last payment error.
//
// This will be unset if the payment method is updated
// or if a payment succeeds.
LastPaymentError *apiv1.Status `json:"lastPaymentError"`
// The creation time of the payment method connection.
CreateTime time.Time `json:"createTime"`
// The last update time of the payment method connection.
Expand Down
Loading

0 comments on commit 9334764

Please sign in to comment.