Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/clients/src/api/mnq/v1alpha1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const jsonContentHeaders = {
}

/**
* MnQ API.
* MnQ API (beta).
*
* This API allows you to manage Messaging or Queueing brokers.
*/
Expand Down
5 changes: 3 additions & 2 deletions packages/clients/src/api/mnq/v1alpha1/marshalling.gen.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// This file was automatically generated. DO NOT EDIT.
// If you have any remark or suggestion do not hesitate to open an issue.
import randomName from '@scaleway/random-name'
import {
isJSONObject,
resolveOneOf,
Expand Down Expand Up @@ -217,7 +218,7 @@ export const marshalCreateCredentialRequest = (
request: CreateCredentialRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
name: request.name,
name: request.name || randomName('mnq'),
namespace_id: request.namespaceId,
...resolveOneOf([
{
Expand All @@ -233,7 +234,7 @@ export const marshalCreateNamespaceRequest = (
request: CreateNamespaceRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
name: request.name,
name: request.name || randomName('mnq'),
project_id: request.projectId ?? defaults.defaultProjectId,
protocol: request.protocol,
})
Expand Down
101 changes: 93 additions & 8 deletions packages/clients/src/api/mnq/v1alpha1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,170 +22,255 @@ export type ListNamespacesRequestOrderBy =

export type NamespaceProtocol = 'unknown' | 'nats' | 'sqs_sns' | 'amqp'

/** Credential */
export interface Credential {
/** Credential ID */
id: string
/** Credential name */
name: string
/** Namespace containing the Credential */
namespaceId: string
/** Protocol associated to the Credential */
protocol: NamespaceProtocol
/**
* Credentials file used to connect to the NATS service.
*
* One-of ('credentialType'): at most one of 'natsCredentials',
* 'sqsSnsCredentials', 'amqpCredentials' could be set.
*/
natsCredentials?: CredentialNATSCredsFile
/**
* Credential used to connect to the SQS/SNS service.
*
* One-of ('credentialType'): at most one of 'natsCredentials',
* 'sqsSnsCredentials', 'amqpCredentials' could be set.
*/
sqsSnsCredentials?: CredentialSQSSNSCreds
/**
* Credential used to connect to the AMQP service.
*
* One-of ('credentialType'): at most one of 'natsCredentials',
* 'sqsSnsCredentials', 'amqpCredentials' could be set.
*/
amqpCredentials?: CredentialAMQPCreds
}

/** Credential.amqp creds */
export interface CredentialAMQPCreds {
/** Username used to connect to the AMQP service */
username: string
/** Password used to connect to the AMQP service */
password?: string
/** List of permissions associated to this Credential */
permissions?: Permissions
}

/** Credential.nats creds file */
export interface CredentialNATSCredsFile {
/** Raw content of the NATS credentials file */
content: string
}

/** Credential.sqssns creds */
export interface CredentialSQSSNSCreds {
/** ID of the key */
accessKey: string
/** Secret value of the key */
secretKey?: string
/** List of permissions associated to this Credential */
permissions?: Permissions
}

/** Credential summary */
export interface CredentialSummary {
/** Credential ID */
id: string
/** Credential name */
name: string
/** Namespace containing the Credential */
namespaceId: string
/** Protocol associated to the Credential */
protocol: NamespaceProtocol
/**
* Credential used to connect to the SQS/SNS service.
*
* One-of ('credentialType'): at most one of 'sqsSnsCredentials',
* 'amqpCredentials' could be set.
*/
sqsSnsCredentials?: CredentialSummarySQSSNSCreds
/**
* Credential used to connect to the AMQP service.
*
* One-of ('credentialType'): at most one of 'sqsSnsCredentials',
* 'amqpCredentials' could be set.
*/
amqpCredentials?: CredentialSummaryAMQPCreds
}

/** Credential summary.amqp creds */
export interface CredentialSummaryAMQPCreds {
/** Username used to connect to the AMQP service */
username: string
/** List of permissions associated to this Credential */
permissions?: Permissions
}

/** Credential summary.sqssns creds */
export interface CredentialSummarySQSSNSCreds {
/** ID of the key */
accessKey: string
/** List of permissions associated to this Credential */
permissions?: Permissions
}

/** List credentials response */
export interface ListCredentialsResponse {
/** Total number of existing Credentials */
totalCount: number
/** A page of Credentials */
credentials: Array<CredentialSummary>
}

/** List namespaces response */
export interface ListNamespacesResponse {
/** Total number of existing Namespaces */
totalCount: number
/** A page of Namespaces */
namespaces: Array<Namespace>
}

/** Namespace */
export interface Namespace {
/** Namespace ID */
id: string
projectId: string
/** Namespace name */
name: string
/** Endpoint of the service matching the Namespace protocol */
endpoint: string
/** Namespace protocol */
protocol: NamespaceProtocol
/** Project containing the Namespace */
projectId: string
/** Region where the Namespace is deployed */
region: Region
/** Namespace creation date */
createdAt?: Date
/** Namespace last modification date */
updatedAt?: Date
region: Region
}

/** Permissions */
export interface Permissions {
/** Defines if user can publish messages to the service */
canPublish?: boolean
/** Defines if user can receive messages from the service */
canReceive?: boolean
/** Defines if user can manage the associated resource(s) */
canManage?: boolean
}

export type ListNamespacesRequest = {
/** Region to target. If none is passed will use default region from the config */
region?: Region
/** Will list only the Namespaces owned by the specified organization */
organizationId?: string
/** Will list only the Namespaces contained into the specified project */
projectId?: string
/** Indicate the page number of results to be returned */
page?: number
/** Maximum number of results returned by page */
pageSize?: number
/** Field used for sorting results */
orderBy?: ListNamespacesRequestOrderBy
organizationId?: string
}

export type CreateNamespaceRequest = {
/** Region to target. If none is passed will use default region from the config */
region?: Region
name: string
projectId?: string
/** Namespace name */
name?: string
/** Namespace protocol */
protocol: NamespaceProtocol
/** Project containing the Namespace */
projectId?: string
}

export type UpdateNamespaceRequest = {
/** Region to target. If none is passed will use default region from the config */
region?: Region
/** ID of the Namespace to update */
namespaceId: string
/** Namespace name */
name?: string
}

export type GetNamespaceRequest = {
/** Region to target. If none is passed will use default region from the config */
region?: Region
/** ID of the Namespace to get */
namespaceId: string
}

export type DeleteNamespaceRequest = {
/** Region to target. If none is passed will use default region from the config */
region?: Region
/** ID of the Namespace to delete */
namespaceId: string
}

export type CreateCredentialRequest = {
/** Region to target. If none is passed will use default region from the config */
region?: Region
name: string
/** Namespace containing the Credential */
namespaceId: string
/** One-of ('optionalPermissions'): at most one of 'permissions' could be set. */
/** Credential name */
name?: string
/**
* List of permissions associated to this Credential.
*
* One-of ('optionalPermissions'): at most one of 'permissions' could be set.
*/
permissions?: Permissions
}

export type DeleteCredentialRequest = {
/** Region to target. If none is passed will use default region from the config */
region?: Region
/** ID of the Credential to delete */
credentialId: string
}

export type ListCredentialsRequest = {
/** Region to target. If none is passed will use default region from the config */
region?: Region
/** Namespace containing the Credential */
namespaceId?: string
/** Indicate the page number of results to be returned */
page?: number
/** Maximum number of results returned by page */
pageSize?: number
/** Field used for sorting results */
orderBy?: ListCredentialsRequestOrderBy
}

export type UpdateCredentialRequest = {
/** Region to target. If none is passed will use default region from the config */
region?: Region
/** ID of the Credential to update */
credentialId: string
/** Credential name */
name?: string
/** One-of ('optionalPermissions'): at most one of 'permissions' could be set. */
/**
* List of permissions associated to this Credential.
*
* One-of ('optionalPermissions'): at most one of 'permissions' could be set.
*/
permissions?: Permissions
}

export type GetCredentialRequest = {
/** Region to target. If none is passed will use default region from the config */
region?: Region
/** ID of the Credential to get */
credentialId: string
}