Skip to content

Commit bb69a7e

Browse files
committed
fix(discovery_v1): update status model
1 parent f4579b4 commit bb69a7e

File tree

2 files changed

+32
-33
lines changed

2 files changed

+32
-33
lines changed

discovery/v1.ts

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3792,9 +3792,8 @@ class DiscoveryV1 extends BaseService {
37923792
* @param {CredentialDetails} [params.credentialDetails] - Object containing details of the stored credentials.
37933793
*
37943794
* Obtain credentials for your source from the administrator of the source.
3795-
* @param {string} [params.status] - The current status of this set of credentials. `connected` indicates that the
3796-
* credentials are available to use with the source configuration of a collection. `invalid` refers to the credentials
3797-
* (for example, the password provided has expired) and must be corrected before they can be used with a collection.
3795+
* @param {StatusDetails} [params.status] - Object that contains details about the status of the authentication
3796+
* process.
37983797
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
37993798
* @returns {Promise<DiscoveryV1.Response<DiscoveryV1.Credentials>>}
38003799
*/
@@ -3934,9 +3933,8 @@ class DiscoveryV1 extends BaseService {
39343933
* @param {CredentialDetails} [params.credentialDetails] - Object containing details of the stored credentials.
39353934
*
39363935
* Obtain credentials for your source from the administrator of the source.
3937-
* @param {string} [params.status] - The current status of this set of credentials. `connected` indicates that the
3938-
* credentials are available to use with the source configuration of a collection. `invalid` refers to the credentials
3939-
* (for example, the password provided has expired) and must be corrected before they can be used with a collection.
3936+
* @param {StatusDetails} [params.status] - Object that contains details about the status of the authentication
3937+
* process.
39403938
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
39413939
* @returns {Promise<DiscoveryV1.Response<DiscoveryV1.Credentials>>}
39423940
*/
@@ -5413,11 +5411,8 @@ namespace DiscoveryV1 {
54135411
* Obtain credentials for your source from the administrator of the source.
54145412
*/
54155413
credentialDetails?: CredentialDetails;
5416-
/** The current status of this set of credentials. `connected` indicates that the credentials are available to
5417-
* use with the source configuration of a collection. `invalid` refers to the credentials (for example, the
5418-
* password provided has expired) and must be corrected before they can be used with a collection.
5419-
*/
5420-
status?: CreateCredentialsConstants.Status | string;
5414+
/** Object that contains details about the status of the authentication process. */
5415+
status?: StatusDetails;
54215416
headers?: OutgoingHttpHeaders;
54225417
}
54235418

@@ -5431,11 +5426,6 @@ namespace DiscoveryV1 {
54315426
WEB_CRAWL = 'web_crawl',
54325427
CLOUD_OBJECT_STORAGE = 'cloud_object_storage',
54335428
}
5434-
/** The current status of this set of credentials. `connected` indicates that the credentials are available to use with the source configuration of a collection. `invalid` refers to the credentials (for example, the password provided has expired) and must be corrected before they can be used with a collection. */
5435-
export enum Status {
5436-
CONNECTED = 'connected',
5437-
INVALID = 'invalid',
5438-
}
54395429
}
54405430

54415431
/** Parameters for the `getCredentials` operation. */
@@ -5466,11 +5456,8 @@ namespace DiscoveryV1 {
54665456
* Obtain credentials for your source from the administrator of the source.
54675457
*/
54685458
credentialDetails?: CredentialDetails;
5469-
/** The current status of this set of credentials. `connected` indicates that the credentials are available to
5470-
* use with the source configuration of a collection. `invalid` refers to the credentials (for example, the
5471-
* password provided has expired) and must be corrected before they can be used with a collection.
5472-
*/
5473-
status?: UpdateCredentialsConstants.Status | string;
5459+
/** Object that contains details about the status of the authentication process. */
5460+
status?: StatusDetails;
54745461
headers?: OutgoingHttpHeaders;
54755462
}
54765463

@@ -5484,11 +5471,6 @@ namespace DiscoveryV1 {
54845471
WEB_CRAWL = 'web_crawl',
54855472
CLOUD_OBJECT_STORAGE = 'cloud_object_storage',
54865473
}
5487-
/** The current status of this set of credentials. `connected` indicates that the credentials are available to use with the source configuration of a collection. `invalid` refers to the credentials (for example, the password provided has expired) and must be corrected before they can be used with a collection. */
5488-
export enum Status {
5489-
CONNECTED = 'connected',
5490-
INVALID = 'invalid',
5491-
}
54925474
}
54935475

54945476
/** Parameters for the `deleteCredentials` operation. */
@@ -5777,11 +5759,8 @@ namespace DiscoveryV1 {
57775759
* Obtain credentials for your source from the administrator of the source.
57785760
*/
57795761
credential_details?: CredentialDetails;
5780-
/** The current status of this set of credentials. `connected` indicates that the credentials are available to
5781-
* use with the source configuration of a collection. `invalid` refers to the credentials (for example, the
5782-
* password provided has expired) and must be corrected before they can be used with a collection.
5783-
*/
5784-
status?: string;
5762+
/** Object that contains details about the status of the authentication process. */
5763+
status?: StatusDetails;
57855764
}
57865765

57875766
/** Object containing array of credential definitions. */
@@ -6819,6 +6798,14 @@ namespace DiscoveryV1 {
68196798
next_crawl?: string;
68206799
}
68216800

6801+
/** Object that contains details about the status of the authentication process. */
6802+
export interface StatusDetails {
6803+
/** Indicates whether the credential is accepted by the target data source. */
6804+
authentication?: boolean;
6805+
/** If `authentication` is `false`, a message describes why the authentication was unsuccessful. */
6806+
error_message?: string;
6807+
}
6808+
68226809
/** An object defining a single tokenizaion rule. */
68236810
export interface TokenDictRule {
68246811
/** The string to tokenize. */

test/unit/discovery.v1.test.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4890,12 +4890,18 @@ describe('DiscoveryV1', () => {
48904890
secret_access_key: 'testString',
48914891
};
48924892

4893+
// StatusDetails
4894+
const statusDetailsModel = {
4895+
authentication: true,
4896+
error_message: 'testString',
4897+
};
4898+
48934899
test('should pass the right params to createRequest', () => {
48944900
// Construct the params object for operation createCredentials
48954901
const environmentId = 'testString';
48964902
const sourceType = 'box';
48974903
const credentialDetails = credentialDetailsModel;
4898-
const status = 'connected';
4904+
const status = statusDetailsModel;
48994905
const params = {
49004906
environmentId: environmentId,
49014907
sourceType: sourceType,
@@ -5067,13 +5073,19 @@ describe('DiscoveryV1', () => {
50675073
secret_access_key: 'testString',
50685074
};
50695075

5076+
// StatusDetails
5077+
const statusDetailsModel = {
5078+
authentication: true,
5079+
error_message: 'testString',
5080+
};
5081+
50705082
test('should pass the right params to createRequest', () => {
50715083
// Construct the params object for operation updateCredentials
50725084
const environmentId = 'testString';
50735085
const credentialId = 'testString';
50745086
const sourceType = 'box';
50755087
const credentialDetails = credentialDetailsModel;
5076-
const status = 'connected';
5088+
const status = statusDetailsModel;
50775089
const params = {
50785090
environmentId: environmentId,
50795091
credentialId: credentialId,

0 commit comments

Comments
 (0)