Skip to content

Commit e8dd827

Browse files
authored
docs(mnq): revamp (#585)
1 parent 3cb7ec1 commit e8dd827

File tree

2 files changed

+95
-57
lines changed

2 files changed

+95
-57
lines changed

packages/clients/src/api/mnq/v1alpha1/api.gen.ts

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ const jsonContentHeaders = {
4141
/**
4242
* MnQ API (beta).
4343
*
44-
* This API allows you to manage Messaging or Queueing brokers. MnQ API (beta).
44+
* This API allows you to manage Scaleway Messaging and Queueing brokers. MnQ
45+
* API (beta).
4546
*/
4647
export class API extends ParentAPI {
4748
/** Lists the available regions of the API. */
@@ -72,7 +73,10 @@ export class API extends ParentAPI {
7273
)
7374

7475
/**
75-
* List namespaces.
76+
* List namespaces. List all Messaging and Queuing namespaces in the specified
77+
* region, for a Scaleway Organization or Project. By default, the namespaces
78+
* returned in the list are ordered by creation date in ascending order,
79+
* though this can be modified via the `order_by` field.
7680
*
7781
* @param request - The request {@link ListNamespacesRequest}
7882
* @returns A Promise of ListNamespacesResponse
@@ -81,7 +85,8 @@ export class API extends ParentAPI {
8185
enrichForPagination('namespaces', this.pageOfListNamespaces, request)
8286

8387
/**
84-
* Create a namespace.
88+
* Create a namespace. Create a Messaging and Queuing namespace, set to the
89+
* desired protocol.
8590
*
8691
* @param request - The request {@link CreateNamespaceRequest}
8792
* @returns A Promise of Namespace
@@ -103,7 +108,8 @@ export class API extends ParentAPI {
103108
)
104109

105110
/**
106-
* Update the name of a namespace.
111+
* Update the name of a namespace. Update the name of a Messaging and Queuing
112+
* namespace, specified by its namespace ID.
107113
*
108114
* @param request - The request {@link UpdateNamespaceRequest}
109115
* @returns A Promise of Namespace
@@ -125,7 +131,9 @@ export class API extends ParentAPI {
125131
)
126132

127133
/**
128-
* Get a namespace.
134+
* Get a namespace. Retrieve information about an existing Messaging and
135+
* Queuing namespace, identified by its namespace ID. Its full details,
136+
* including name, endpoint and protocol, are returned in the response.
129137
*
130138
* @param request - The request {@link GetNamespaceRequest}
131139
* @returns A Promise of Namespace
@@ -143,7 +151,10 @@ export class API extends ParentAPI {
143151
)
144152

145153
/**
146-
* Delete a namespace.
154+
* Delete a namespace. Delete a Messaging and Queuing namespace, specified by
155+
* its namespace ID. Note that deleting a namespace is irreversible, and any
156+
* URLs, credentials and queued messages belonging to this namespace will also
157+
* be deleted.
147158
*
148159
* @param request - The request {@link DeleteNamespaceRequest}
149160
*/
@@ -157,8 +168,11 @@ export class API extends ParentAPI {
157168
})
158169

159170
/**
160-
* Create a set of credentials. Create a set of credentials for a specific
161-
* namespace.
171+
* Create credentials. Create a set of credentials for a Messaging and Queuing
172+
* namespace, specified by its namespace ID. If creating credentials for a
173+
* NATS namespace, the `permissions` object must not be included in the
174+
* request. If creating credentials for an SQS/SNS namespace, the
175+
* `permissions` object is required, with all three of its child attributes.
162176
*
163177
* @param request - The request {@link CreateCredentialRequest}
164178
* @returns A Promise of Credential
@@ -180,7 +194,9 @@ export class API extends ParentAPI {
180194
)
181195

182196
/**
183-
* Delete credentials.
197+
* Delete credentials. Delete a set of credentials, specified by their
198+
* credential ID. Deleting credentials is irreversible and cannot be undone.
199+
* The credentials can no longer be used to access the namespace.
184200
*
185201
* @param request - The request {@link DeleteCredentialRequest}
186202
*/
@@ -220,7 +236,9 @@ export class API extends ParentAPI {
220236
)
221237

222238
/**
223-
* List credentials.
239+
* List credentials. List existing credentials in the specified region. The
240+
* response contains only the metadata for the credentials, not the
241+
* credentials themselves (for this, use **Get Credentials**).
224242
*
225243
* @param request - The request {@link ListCredentialsRequest}
226244
* @returns A Promise of ListCredentialsResponse
@@ -229,7 +247,10 @@ export class API extends ParentAPI {
229247
enrichForPagination('credentials', this.pageOfListCredentials, request)
230248

231249
/**
232-
* Update a set of credentials.
250+
* Update credentials. Update a set of credentials. You can update the
251+
* credentials' name, or (in the case of SQS/SNS credentials only) their
252+
* permissions. To update the name of NATS credentials, do not include the
253+
* `permissions` object in your request.
233254
*
234255
* @param request - The request {@link UpdateCredentialRequest}
235256
* @returns A Promise of Credential
@@ -254,7 +275,9 @@ export class API extends ParentAPI {
254275
)
255276

256277
/**
257-
* Get a set of credentials.
278+
* Get credentials. Retrieve an existing set of credentials, identified by the
279+
* `credential_id`. The credentials themselves, as well as their metadata
280+
* (protocol, namespace ID etc), are returned in the response.
258281
*
259282
* @param request - The request {@link GetCredentialRequest}
260283
* @returns A Promise of Credential

packages/clients/src/api/mnq/v1alpha1/types.gen.ts

Lines changed: 60 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,25 @@ export type NamespaceProtocol = 'unknown' | 'nats' | 'sqs_sns'
2424

2525
/** Credential. */
2626
export interface Credential {
27-
/** Credential ID. */
27+
/** ID of the credentials. */
2828
id: string
29-
/** Credential name. */
29+
/** Name of the credentials. */
3030
name: string
31-
/** Namespace containing the Credential. */
31+
/** Namespace containing the credentials. */
3232
namespaceId: string
33-
/** Protocol associated to the Credential. */
33+
/** Protocol associated with the credentials. */
3434
protocol: NamespaceProtocol
3535
/**
36-
* Credentials file used to connect to the NATS service.
36+
* Object containing the credentials, if the credentials are for a NATS
37+
* namespace.
3738
*
3839
* One-of ('credentialType'): at most one of 'natsCredentials',
3940
* 'sqsSnsCredentials' could be set.
4041
*/
4142
natsCredentials?: CredentialNATSCredsFile
4243
/**
43-
* Credential used to connect to the SQS/SNS service.
44+
* Object containing the credentials and their metadata, if the credentials
45+
* are for an SQS/SNS namespace.
4446
*
4547
* One-of ('credentialType'): at most one of 'natsCredentials',
4648
* 'sqsSnsCredentials' could be set.
@@ -56,26 +58,27 @@ export interface CredentialNATSCredsFile {
5658

5759
/** Credential.sqssns creds. */
5860
export interface CredentialSQSSNSCreds {
59-
/** ID of the key. */
61+
/** Access key ID. */
6062
accessKey: string
61-
/** Secret value of the key. */
63+
/** Secret key ID. */
6264
secretKey?: string
63-
/** List of permissions associated to this Credential. */
65+
/** Permissions associated with these credentials. */
6466
permissions?: Permissions
6567
}
6668

6769
/** Credential summary. */
6870
export interface CredentialSummary {
69-
/** Credential ID. */
71+
/** ID of the credentials. */
7072
id: string
71-
/** Credential name. */
73+
/** Name of the credentials. */
7274
name: string
73-
/** Namespace containing the Credential. */
75+
/** Namespace containing the credentials. */
7476
namespaceId: string
75-
/** Protocol associated to the Credential. */
77+
/** Protocol associated with the credentials. */
7678
protocol: NamespaceProtocol
7779
/**
78-
* Credential used to connect to the SQS/SNS service.
80+
* Object containing the credentials and their metadata, if the credentials
81+
* are for an SQS/SNS namespace.
7982
*
8083
* One-of ('credentialType'): at most one of 'sqsSnsCredentials' could be set.
8184
*/
@@ -84,25 +87,25 @@ export interface CredentialSummary {
8487

8588
/** Credential summary.sqssns creds. */
8689
export interface CredentialSummarySQSSNSCreds {
87-
/** ID of the key. */
90+
/** Access key ID. */
8891
accessKey: string
89-
/** List of permissions associated to this Credential. */
92+
/** Permissions associated with these credentials. */
9093
permissions?: Permissions
9194
}
9295

9396
/** List credentials response. */
9497
export interface ListCredentialsResponse {
95-
/** Total number of existing Credentials. */
98+
/** Total count of existing credentials (matching any filters specified). */
9699
totalCount: number
97-
/** A page of Credentials. */
100+
/** Credentials on this page. */
98101
credentials: CredentialSummary[]
99102
}
100103

101104
/** List namespaces response. */
102105
export interface ListNamespacesResponse {
103-
/** Total number of existing Namespaces. */
106+
/** Total count of existing namespaces (matching any filters specified). */
104107
totalCount: number
105-
/** A page of Namespaces. */
108+
/** Namespaces on this page. */
106109
namespaces: Namespace[]
107110
}
108111

@@ -112,13 +115,13 @@ export interface Namespace {
112115
id: string
113116
/** Namespace name. */
114117
name: string
115-
/** Endpoint of the service matching the Namespace protocol. */
118+
/** Endpoint of the service matching the namespace's protocol. */
116119
endpoint: string
117120
/** Namespace protocol. */
118121
protocol: NamespaceProtocol
119-
/** Project containing the Namespace. */
122+
/** Project ID of the Project containing the namespace. */
120123
projectId: string
121-
/** Region where the Namespace is deployed. */
124+
/** Region where the namespace is deployed. */
122125
region: Region
123126
/** Namespace creation date. */
124127
createdAt?: Date
@@ -128,11 +131,20 @@ export interface Namespace {
128131

129132
/** Permissions. */
130133
export interface Permissions {
131-
/** Defines if user can publish messages to the service. */
134+
/**
135+
* Defines whether the credentials bearer can publish messages to the service
136+
* (send messages to SQS queues or publish to SNS topics).
137+
*/
132138
canPublish?: boolean
133-
/** Defines if user can receive messages from the service. */
139+
/**
140+
* Defines whether the credentials bearer can receive messages from the
141+
* service.
142+
*/
134143
canReceive?: boolean
135-
/** Defines if user can manage the associated resource(s). */
144+
/**
145+
* Defines whether the credentials bearer can manage the associated resources
146+
* (SQS queues or SNS topics or subscriptions).
147+
*/
136148
canManage?: boolean
137149
}
138150

@@ -142,15 +154,15 @@ export type ListNamespacesRequest = {
142154
* config.
143155
*/
144156
region?: Region
145-
/** Will list only the Namespaces owned by the specified organization. */
157+
/** Include only namespaces in this Organization. */
146158
organizationId?: string
147-
/** Will list only the Namespaces contained into the specified project. */
159+
/** Include only namespaces in this Project. */
148160
projectId?: string
149-
/** Indicate the page number of results to be returned. */
161+
/** Page number to return. */
150162
page?: number
151-
/** Maximum number of results returned by page. */
163+
/** Maximum number of namespaces to return per page. */
152164
pageSize?: number
153-
/** Field used for sorting results. */
165+
/** Order in which to return results. */
154166
orderBy?: ListNamespacesRequestOrderBy
155167
}
156168

@@ -162,7 +174,10 @@ export type CreateNamespaceRequest = {
162174
region?: Region
163175
/** Namespace name. */
164176
name?: string
165-
/** Namespace protocol. */
177+
/**
178+
* Namespace protocol. You must specify a valid protocol (and not `unknown`)
179+
* to avoid an error.
180+
*/
166181
protocol: NamespaceProtocol
167182
/** Project containing the Namespace. */
168183
projectId?: string
@@ -196,7 +211,7 @@ export type DeleteNamespaceRequest = {
196211
* config.
197212
*/
198213
region?: Region
199-
/** ID of the Namespace to delete. */
214+
/** ID of the namespace to delete. */
200215
namespaceId: string
201216
}
202217

@@ -206,12 +221,12 @@ export type CreateCredentialRequest = {
206221
* config.
207222
*/
208223
region?: Region
209-
/** Namespace containing the Credential. */
224+
/** Namespace containing the credentials. */
210225
namespaceId: string
211-
/** Credential name. */
226+
/** Name of the credentials. */
212227
name?: string
213228
/**
214-
* List of permissions associated to this Credential.
229+
* Permissions associated with these credentials.
215230
*
216231
* One-of ('optionalPermissions'): at most one of 'permissions' could be set.
217232
*/
@@ -224,7 +239,7 @@ export type DeleteCredentialRequest = {
224239
* config.
225240
*/
226241
region?: Region
227-
/** ID of the Credential to delete. */
242+
/** ID of the credentials to delete. */
228243
credentialId: string
229244
}
230245

@@ -234,13 +249,13 @@ export type ListCredentialsRequest = {
234249
* config.
235250
*/
236251
region?: Region
237-
/** Namespace containing the Credential. */
252+
/** Namespace containing the credentials. */
238253
namespaceId?: string
239-
/** Indicate the page number of results to be returned. */
254+
/** Page number to return. */
240255
page?: number
241-
/** Maximum number of results returned by page. */
256+
/** Maximum number of credentials to return per page. */
242257
pageSize?: number
243-
/** Field used for sorting results. */
258+
/** Order in which to return results. */
244259
orderBy?: ListCredentialsRequestOrderBy
245260
}
246261

@@ -250,12 +265,12 @@ export type UpdateCredentialRequest = {
250265
* config.
251266
*/
252267
region?: Region
253-
/** ID of the Credential to update. */
268+
/** ID of the credentials to update. */
254269
credentialId: string
255-
/** Credential name. */
270+
/** Name of the credentials. */
256271
name?: string
257272
/**
258-
* List of permissions associated to this Credential.
273+
* Permissions associated with these credentials.
259274
*
260275
* One-of ('optionalPermissions'): at most one of 'permissions' could be set.
261276
*/
@@ -268,6 +283,6 @@ export type GetCredentialRequest = {
268283
* config.
269284
*/
270285
region?: Region
271-
/** ID of the Credential to get. */
286+
/** ID of the credentials to get. */
272287
credentialId: string
273288
}

0 commit comments

Comments
 (0)