Skip to content

Commit

Permalink
feat: track latest spec and regenerate bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
paambaati authored Jul 25, 2024
1 parent fe1dff9 commit f28d12c
Show file tree
Hide file tree
Showing 3 changed files with 173 additions and 7 deletions.
88 changes: 88 additions & 0 deletions generated/schemas.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2767,3 +2767,91 @@ export const $SupportTicketSeverity = {
type: 'string',
enum: ['low', 'normal', 'high', 'critical']
} as const;

export const $AnnotationData = {
type: 'object',
'x-tags': ['Branch'],
required: ['object', 'value'],
properties: {
object: {
'$ref': '#/components/schemas/AnnotationObjectData'
},
value: {
'$ref': '#/components/schemas/AnnotationValueData'
},
created_at: {
type: 'string',
format: 'date-time'
},
updated_at: {
type: 'string',
format: 'date-time'
}
}
} as const;

export const $AnnotationValueData = {
type: 'object',
'x-tags': ['Branch'],
additionalProperties: {
type: 'string'
}
} as const;

export const $AnnotationObjectData = {
type: 'object',
'x-tags': ['Branch'],
required: ['type', 'id'],
properties: {
type: {
type: 'string'
},
id: {
type: 'string'
}
}
} as const;

export const $AnnotationObjectsData = {
type: 'array',
'x-tags': ['Branch'],
items: {
'$ref': '#/components/schemas/AnnotationObjectData'
}
} as const;

export const $AnnotationResponse = {
type: 'object',
'x-tags': ['Branch'],
properties: {
annotation: {
'$ref': '#/components/schemas/AnnotationData'
}
}
} as const;

export const $AnnotationsResponse = {
type: 'object',
'x-tags': ['Branch'],
properties: {
annotations: {
type: 'array',
items: {
'$ref': '#/components/schemas/AnnotationData'
}
}
}
} as const;

export const $AnnotationsMapResponse = {
type: 'object',
'x-tags': ['Branch'],
properties: {
annotations: {
type: 'object',
additionalProperties: {
'$ref': '#/components/schemas/AnnotationData'
}
}
}
} as const;
28 changes: 25 additions & 3 deletions generated/services.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import type { CancelablePromise } from './core/CancelablePromise';
import type { BaseHttpRequest } from './core/BaseHttpRequest';
import type { ListApiKeysResponse, CreateApiKeyData, CreateApiKeyResponse, RevokeApiKeyData, RevokeApiKeyResponse, GetProjectOperationData, GetProjectOperationResponse, ListProjectOperationsData, ListProjectOperationsResponse, ListProjectsData, ListProjectsResponse, CreateProjectData, CreateProjectResponse, ListSharedProjectsData, ListSharedProjectsResponse, GetProjectData, GetProjectResponse, UpdateProjectData, UpdateProjectResponse, DeleteProjectData, DeleteProjectResponse, ListProjectPermissionsData, ListProjectPermissionsResponse, GrantPermissionToProjectData, GrantPermissionToProjectResponse, RevokePermissionFromProjectData, RevokePermissionFromProjectResponse, GetConnectionUriData, GetConnectionUriResponse, CreateProjectBranchData, CreateProjectBranchResponse, ListProjectBranchesData, ListProjectBranchesResponse, GetProjectBranchData, GetProjectBranchResponse, DeleteProjectBranchData, DeleteProjectBranchResponse, UpdateProjectBranchData, UpdateProjectBranchResponse, RestoreProjectBranchData, RestoreProjectBranchResponse, GetProjectBranchSchemaData, GetProjectBranchSchemaResponse, SetPrimaryProjectBranchData, SetPrimaryProjectBranchResponse, SetDefaultProjectBranchData, SetDefaultProjectBranchResponse, ListProjectBranchEndpointsData, ListProjectBranchEndpointsResponse, ListProjectBranchDatabasesData, ListProjectBranchDatabasesResponse, CreateProjectBranchDatabaseData, CreateProjectBranchDatabaseResponse, GetProjectBranchDatabaseData, GetProjectBranchDatabaseResponse, UpdateProjectBranchDatabaseData, UpdateProjectBranchDatabaseResponse, DeleteProjectBranchDatabaseData, DeleteProjectBranchDatabaseResponse, ListProjectBranchRolesData, ListProjectBranchRolesResponse, CreateProjectBranchRoleData, CreateProjectBranchRoleResponse, GetProjectBranchRoleData, GetProjectBranchRoleResponse, DeleteProjectBranchRoleData, DeleteProjectBranchRoleResponse, GetProjectBranchRolePasswordData, GetProjectBranchRolePasswordResponse, ResetProjectBranchRolePasswordData, ResetProjectBranchRolePasswordResponse, CreateProjectEndpointData, CreateProjectEndpointResponse, ListProjectEndpointsData, ListProjectEndpointsResponse, GetProjectEndpointData, GetProjectEndpointResponse, DeleteProjectEndpointData, DeleteProjectEndpointResponse, UpdateProjectEndpointData, UpdateProjectEndpointResponse, StartProjectEndpointData, StartProjectEndpointResponse, SuspendProjectEndpointData, SuspendProjectEndpointResponse, RestartProjectEndpointData, RestartProjectEndpointResponse, GetConsumptionHistoryPerAccountData, GetConsumptionHistoryPerAccountResponse, GetConsumptionHistoryPerProjectData, GetConsumptionHistoryPerProjectResponse, ListProjectsConsumptionData, ListProjectsConsumptionResponse, GetCurrentUserInfoResponse, GetCurrentUserOrganizationsResponse } from './types.gen';
import type { ListApiKeysResponse, CreateApiKeyData, CreateApiKeyResponse, RevokeApiKeyData, RevokeApiKeyResponse, GetProjectOperationData, GetProjectOperationResponse, ListProjectOperationsData, ListProjectOperationsResponse, ListProjectsData, ListProjectsResponse, CreateProjectData, CreateProjectResponse, ListSharedProjectsData, ListSharedProjectsResponse, GetProjectData, GetProjectResponse, UpdateProjectData, UpdateProjectResponse, DeleteProjectData, DeleteProjectResponse, ListProjectPermissionsData, ListProjectPermissionsResponse, GrantPermissionToProjectData, GrantPermissionToProjectResponse, RevokePermissionFromProjectData, RevokePermissionFromProjectResponse, GetConnectionUriData, GetConnectionUriResponse, CreateProjectBranchData, CreateProjectBranchResponse, ListProjectBranchesData, ListProjectBranchesResponse, GetProjectBranchData, GetProjectBranchResponse, DeleteProjectBranchData, DeleteProjectBranchResponse, UpdateProjectBranchData, UpdateProjectBranchResponse, RestoreProjectBranchData, RestoreProjectBranchResponse, GetProjectBranchSchemaData, GetProjectBranchSchemaResponse, SetPrimaryProjectBranchData, SetPrimaryProjectBranchResponse, SetDefaultProjectBranchData, SetDefaultProjectBranchResponse, ListProjectBranchEndpointsData, ListProjectBranchEndpointsResponse, ListProjectBranchDatabasesData, ListProjectBranchDatabasesResponse, CreateProjectBranchDatabaseData, CreateProjectBranchDatabaseResponse, GetProjectBranchDatabaseData, GetProjectBranchDatabaseResponse, UpdateProjectBranchDatabaseData, UpdateProjectBranchDatabaseResponse, DeleteProjectBranchDatabaseData, DeleteProjectBranchDatabaseResponse, ListProjectBranchRolesData, ListProjectBranchRolesResponse, CreateProjectBranchRoleData, CreateProjectBranchRoleResponse, GetProjectBranchRoleData, GetProjectBranchRoleResponse, DeleteProjectBranchRoleData, DeleteProjectBranchRoleResponse, GetProjectBranchRolePasswordData, GetProjectBranchRolePasswordResponse, ResetProjectBranchRolePasswordData, ResetProjectBranchRolePasswordResponse, ListAnnotationsData, ListAnnotationsResponse, CreateProjectEndpointData, CreateProjectEndpointResponse, ListProjectEndpointsData, ListProjectEndpointsResponse, GetProjectEndpointData, GetProjectEndpointResponse, DeleteProjectEndpointData, DeleteProjectEndpointResponse, UpdateProjectEndpointData, UpdateProjectEndpointResponse, StartProjectEndpointData, StartProjectEndpointResponse, SuspendProjectEndpointData, SuspendProjectEndpointResponse, RestartProjectEndpointData, RestartProjectEndpointResponse, GetConsumptionHistoryPerAccountData, GetConsumptionHistoryPerAccountResponse, GetConsumptionHistoryPerProjectData, GetConsumptionHistoryPerProjectResponse, ListProjectsConsumptionData, ListProjectsConsumptionResponse, GetCurrentUserInfoResponse, GetCurrentUserOrganizationsResponse } from './types.gen';

export class ApiKeyService {
constructor(public readonly httpRequest: BaseHttpRequest) { }
Expand Down Expand Up @@ -471,7 +471,7 @@ export class BranchService {
*
* @param data The data for the request.
* @param data.projectId The Neon project ID
* @returns BranchesResponse Returned a list of branches for the specified project
* @returns unknown Returned a list of branches for the specified project
* @throws ApiError
*/
public listProjectBranches(data: ListProjectBranchesData): CancelablePromise<ListProjectBranchesResponse> {
Expand Down Expand Up @@ -502,7 +502,7 @@ export class BranchService {
* @param data The data for the request.
* @param data.projectId The Neon project ID
* @param data.branchId The branch ID
* @returns BranchResponse Returned information about the specified branch
* @returns unknown Returned information about the specified branch
* @throws ApiError
*/
public getProjectBranch(data: GetProjectBranchData): CancelablePromise<GetProjectBranchResponse> {
Expand Down Expand Up @@ -1067,6 +1067,28 @@ export class BranchService {
});
}

/**
* List annotations
* List annotations
*
* @param data The data for the request.
* @param data.objects A list of annotation objects to query the annotations.
* @returns AnnotationsResponse Annotations provided
* @throws ApiError
*/
public listAnnotations(data: ListAnnotationsData): CancelablePromise<ListAnnotationsResponse> {
return this.httpRequest.request({
method: 'GET',
url: '/annotations',
query: {
objects: data.objects
},
errors: {
default: 'General Error'
}
});
}

}

export class EndpointService {
Expand Down
64 changes: 60 additions & 4 deletions generated/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1823,6 +1823,38 @@ export type RoleOperations = RoleResponse & OperationsResponse;

export type SupportTicketSeverity = 'low' | 'normal' | 'high' | 'critical';

export type AnnotationData = {
object: AnnotationObjectData;
value: AnnotationValueData;
created_at?: string;
updated_at?: string;
};

export type AnnotationValueData = {
[key: string]: (string);
};

export type AnnotationObjectData = {
type: string;
id: string;
};

export type AnnotationObjectsData = Array<AnnotationObjectData>;

export type AnnotationResponse = {
annotation?: AnnotationData;
};

export type AnnotationsResponse = {
annotations?: Array<AnnotationData>;
};

export type AnnotationsMapResponse = {
annotations?: {
[key: string]: AnnotationData;
};
};

export type ListApiKeysResponse = Array<ApiKeysListResponseItem>;

export type CreateApiKeyData = {
Expand Down Expand Up @@ -2008,7 +2040,7 @@ export type ListProjectBranchesData = {
projectId: string;
};

export type ListProjectBranchesResponse = BranchesResponse;
export type ListProjectBranchesResponse = BranchesResponse & AnnotationsMapResponse;

export type GetProjectBranchData = {
/**
Expand All @@ -2021,7 +2053,7 @@ export type GetProjectBranchData = {
projectId: string;
};

export type GetProjectBranchResponse = BranchResponse;
export type GetProjectBranchResponse = BranchResponse & AnnotationResponse;

export type DeleteProjectBranchData = {
/**
Expand Down Expand Up @@ -2308,6 +2340,15 @@ export type ResetProjectBranchRolePasswordData = {

export type ResetProjectBranchRolePasswordResponse = RoleOperations;

export type ListAnnotationsData = {
/**
* A list of annotation objects to query the annotations.
*/
objects: AnnotationObjectsData;
};

export type ListAnnotationsResponse = AnnotationsResponse;

export type CreateProjectEndpointData = {
/**
* The Neon project ID
Expand Down Expand Up @@ -2798,7 +2839,7 @@ export type $OpenApiTs = {
/**
* Returned a list of branches for the specified project
*/
200: BranchesResponse;
200: BranchesResponse & AnnotationsMapResponse;
/**
* General Error
*/
Expand All @@ -2813,7 +2854,7 @@ export type $OpenApiTs = {
/**
* Returned information about the specified branch
*/
200: BranchResponse;
200: BranchResponse & AnnotationResponse;
/**
* General Error
*/
Expand Down Expand Up @@ -3085,6 +3126,21 @@ export type $OpenApiTs = {
};
};
};
'/annotations': {
get: {
req: ListAnnotationsData;
res: {
/**
* Annotations provided
*/
200: AnnotationsResponse;
/**
* General Error
*/
default: GeneralError;
};
};
};
'/projects/{project_id}/endpoints': {
post: {
req: CreateProjectEndpointData;
Expand Down

0 comments on commit f28d12c

Please sign in to comment.