Skip to content

Commit

Permalink
update spec as of 2024-10-01 6:44AM UTC
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Kisler <admin@dkisler.com>
  • Loading branch information
kislerdm committed Oct 1, 2024
1 parent 2587b20 commit 57004cd
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 49 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v0.6.1] - 2024-10-01

The release incorporates the up-to-date [API contract](openAPIDefinition.json) as of 2024-09-28 06:44:00 GMT.

### Added

- Added "azure_mp" as a `BillingPaymentMethod` enum value.

### Changed

- Changed the response type of the method `ListProjects`, `ListProjectsRespObj`. It includes the map
`ProjectsApplicationsMapResponse` which contains all applications available in the project.

### Deprecated

- Deprecated `Login` field in the types `CurrentUserAuthAccount` and `CurrentUserInfoResponse`.

## [v0.6.0] - 2024-09-28

The release incorporates the up-to-date [API contract](openAPIDefinition.json) as of 2024-09-28 21:53:00 GMT.
Expand Down
5 changes: 3 additions & 2 deletions generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1288,8 +1288,9 @@ func (m model) generateCode() string {
}
tmp += objNameGoConventionExport(fieldName) + " " + field.argType(pointerFlag) +
" `json:\"" + field.k + omitEmpty + "\"" +
" pulumi:\"" + field.k + "\"`" +
"\n"
// TODO: add pulumi tags (?)
// " pulumi:\"" + field.k + pulumiOptional + "\"`" +
"`\n"
}

if len(m.fields) == 0 {
Expand Down
2 changes: 1 addition & 1 deletion generator/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,7 @@ FooResponse
},
},
want: []string{
"type FooResponse struct {\nFoo Foo `json:\"foo\" pulumi:\"foo\"`\n}",
"type FooResponse struct {\nFoo Foo `json:\"foo\"`\n}",
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion mockhttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var endpointResponseExamples = map[string]map[string]mockResponse{

"/projects": {
"GET": mockResponse{
Content: `{"projects":[{"active_time":100,"branch_logical_size_limit":0,"branch_logical_size_limit_bytes":10800,"cpu_used_sec":0,"created_at":"2022-11-23T17:42:25Z","creation_source":"console","id":"shiny-wind-028834","name":"shiny-wind-028834","owner_id":"1232111","pg_version":15,"platform_id":"aws","provisioner":"k8s-pod","proxy_host":"us-east-2.aws.neon.tech","region_id":"aws-us-east-2","store_passwords":true,"updated_at":"2022-11-23T17:42:25Z"},{"active_time":100,"branch_logical_size_limit":0,"branch_logical_size_limit_bytes":10800,"cpu_used_sec":0,"created_at":"2022-11-23T17:52:25Z","creation_source":"console","id":"winter-boat-259881","name":"winter-boat-259881","org_id":"org-morning-bread-81040908","owner_id":"1232111","pg_version":15,"platform_id":"aws","provisioner":"k8s-pod","proxy_host":"us-east-2.aws.neon.tech","region_id":"aws-us-east-2","store_passwords":true,"updated_at":"2022-11-23T17:52:25Z"}]}`,
Content: `{"applications":{"winter-boat-259881":["vercel","github"]},"projects":[{"active_time":100,"branch_logical_size_limit":0,"branch_logical_size_limit_bytes":10800,"cpu_used_sec":0,"created_at":"2022-11-23T17:42:25Z","creation_source":"console","id":"shiny-wind-028834","name":"shiny-wind-028834","owner_id":"1232111","pg_version":15,"platform_id":"aws","provisioner":"k8s-pod","proxy_host":"us-east-2.aws.neon.tech","region_id":"aws-us-east-2","store_passwords":true,"updated_at":"2022-11-23T17:42:25Z"},{"active_time":100,"branch_logical_size_limit":0,"branch_logical_size_limit_bytes":10800,"cpu_used_sec":0,"created_at":"2022-11-23T17:52:25Z","creation_source":"console","id":"winter-boat-259881","name":"winter-boat-259881","org_id":"org-morning-bread-81040908","owner_id":"1232111","pg_version":15,"platform_id":"aws","provisioner":"k8s-pod","proxy_host":"us-east-2.aws.neon.tech","region_id":"aws-us-east-2","store_passwords":true,"updated_at":"2022-11-23T17:52:25Z"}]}`,
Code: 200,
},
"POST": mockResponse{
Expand Down
82 changes: 44 additions & 38 deletions openAPIDefinition.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@
},
{
"$ref": "#/components/schemas/PaginationResponse"
},
{
"$ref": "#/components/schemas/ProjectsApplicationsMapResponse"
}
]
},
Expand Down Expand Up @@ -351,7 +354,13 @@
"active_time": 100,
"org_id": "org-morning-bread-81040908"
}
]
],
"applications": {
"winter-boat-259881": [
"vercel",
"github"
]
}
}
}
}
Expand Down Expand Up @@ -5814,41 +5823,6 @@
}
}
},
"NotificationMetricType": {
"type": "string",
"description": "The metric type for a given notification\n",
"enum": [
"database_size",
"connections",
"cpu",
"ram",
"compute_over_limit"
]
},
"NotificationCategoryType": {
"type": "string",
"description": "The category type for a given notification\n",
"enum": [
"usage",
"performance"
]
},
"NotificationType": {
"type": "string",
"description": "The type of the notification\n",
"enum": [
"info",
"warning"
]
},
"NotificationActionType": {
"type": "string",
"description": "The action type for a given notification\n",
"enum": [
"upgrade_plan",
"upgrade_cu"
]
},
"Role": {
"type": "object",
"required": [
Expand Down Expand Up @@ -6115,6 +6089,7 @@
"stripe",
"direct_payment",
"aws_mp",
"azure_mp",
"vercel_mp",
"staff",
"trial",
Expand Down Expand Up @@ -6655,7 +6630,9 @@
"type": "string"
},
"login": {
"type": "string"
"type": "string",
"deprecated": true,
"description": "DEPRECATED. Use `email` field.\n"
},
"name": {
"type": "string"
Expand Down Expand Up @@ -6756,7 +6733,9 @@
"type": "string"
},
"login": {
"type": "string"
"type": "string",
"deprecated": true,
"description": "DEPRECATED. Use `email` field.\n"
},
"name": {
"type": "string"
Expand Down Expand Up @@ -7260,6 +7239,33 @@
}
}
}
},
"ProjectsApplicationsMapResponse": {
"type": "object",
"x-tags": [
"Project"
],
"description": "A map where key is a project ID and a value is a list of available applications.\n",
"required": [
"applications"
],
"properties": {
"applications": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"example": {
"winter-boat-259881": [
"vercel",
"github"
]
}
}
}
}
Expand Down
25 changes: 18 additions & 7 deletions sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,7 @@ type BillingPaymentMethod string
const (
BillingPaymentMethodUNKNOWN BillingPaymentMethod = "UNKNOWN"
BillingPaymentMethodAwsMp BillingPaymentMethod = "aws_mp"
BillingPaymentMethodAzureMp BillingPaymentMethod = "azure_mp"
BillingPaymentMethodDirectPayment BillingPaymentMethod = "direct_payment"
BillingPaymentMethodNone BillingPaymentMethod = "none"
BillingPaymentMethodSponsorship BillingPaymentMethod = "sponsorship"
Expand Down Expand Up @@ -1263,8 +1264,9 @@ type CreatedProject struct {
}

type CurrentUserAuthAccount struct {
Email string `json:"email"`
Image string `json:"image"`
Email string `json:"email"`
Image string `json:"image"`
// Login DEPRECATED. Use `email` field.
Login string `json:"login"`
Name string `json:"name"`
Provider IdentityProviderId `json:"provider"`
Expand All @@ -1281,11 +1283,12 @@ type CurrentUserInfoResponse struct {
ID string `json:"id"`
Image string `json:"image"`
LastName string `json:"last_name"`
Login string `json:"login"`
MaxAutoscalingLimit ComputeUnit `json:"max_autoscaling_limit"`
Name string `json:"name"`
Plan string `json:"plan"`
ProjectsLimit int64 `json:"projects_limit"`
// Login DEPRECATED. Use `email` field.
Login string `json:"login"`
MaxAutoscalingLimit ComputeUnit `json:"max_autoscaling_limit"`
Name string `json:"name"`
Plan string `json:"plan"`
ProjectsLimit int64 `json:"projects_limit"`
}

type Database struct {
Expand Down Expand Up @@ -1533,6 +1536,7 @@ type ListProjectsConsumptionRespObj struct {

type ListProjectsRespObj struct {
PaginationResponse
ProjectsApplicationsMapResponse
ProjectsResponse
}

Expand Down Expand Up @@ -1940,6 +1944,13 @@ type ProjectUpdateRequestProject struct {
Settings *ProjectSettingsData `json:"settings,omitempty"`
}

// ProjectsApplicationsMapResponse A map where key is a project ID and a value is a list of available applications.
type ProjectsApplicationsMapResponse struct {
Applications ProjectsApplicationsMapResponseApplications `json:"applications"`
}

type ProjectsApplicationsMapResponseApplications map[string]interface{}

type ProjectsConsumptionResponse struct {
PeriodsInResponse int64 `json:"periods_in_response"`
Projects []ProjectConsumption `json:"projects"`
Expand Down

0 comments on commit 57004cd

Please sign in to comment.