Skip to content

Commit

Permalink
fix(discovery_v1): update status model
Browse files Browse the repository at this point in the history
  • Loading branch information
Hsaylor committed Sep 10, 2021
1 parent f4579b4 commit bb69a7e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 33 deletions.
49 changes: 18 additions & 31 deletions discovery/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3792,9 +3792,8 @@ class DiscoveryV1 extends BaseService {
* @param {CredentialDetails} [params.credentialDetails] - Object containing details of the stored credentials.
*
* Obtain credentials for your source from the administrator of the source.
* @param {string} [params.status] - 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.
* @param {StatusDetails} [params.status] - Object that contains details about the status of the authentication
* process.
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<DiscoveryV1.Response<DiscoveryV1.Credentials>>}
*/
Expand Down Expand Up @@ -3934,9 +3933,8 @@ class DiscoveryV1 extends BaseService {
* @param {CredentialDetails} [params.credentialDetails] - Object containing details of the stored credentials.
*
* Obtain credentials for your source from the administrator of the source.
* @param {string} [params.status] - 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.
* @param {StatusDetails} [params.status] - Object that contains details about the status of the authentication
* process.
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<DiscoveryV1.Response<DiscoveryV1.Credentials>>}
*/
Expand Down Expand Up @@ -5413,11 +5411,8 @@ namespace DiscoveryV1 {
* Obtain credentials for your source from the administrator of the source.
*/
credentialDetails?: CredentialDetails;
/** 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.
*/
status?: CreateCredentialsConstants.Status | string;
/** Object that contains details about the status of the authentication process. */
status?: StatusDetails;
headers?: OutgoingHttpHeaders;
}

Expand All @@ -5431,11 +5426,6 @@ namespace DiscoveryV1 {
WEB_CRAWL = 'web_crawl',
CLOUD_OBJECT_STORAGE = 'cloud_object_storage',
}
/** 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. */
export enum Status {
CONNECTED = 'connected',
INVALID = 'invalid',
}
}

/** Parameters for the `getCredentials` operation. */
Expand Down Expand Up @@ -5466,11 +5456,8 @@ namespace DiscoveryV1 {
* Obtain credentials for your source from the administrator of the source.
*/
credentialDetails?: CredentialDetails;
/** 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.
*/
status?: UpdateCredentialsConstants.Status | string;
/** Object that contains details about the status of the authentication process. */
status?: StatusDetails;
headers?: OutgoingHttpHeaders;
}

Expand All @@ -5484,11 +5471,6 @@ namespace DiscoveryV1 {
WEB_CRAWL = 'web_crawl',
CLOUD_OBJECT_STORAGE = 'cloud_object_storage',
}
/** 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. */
export enum Status {
CONNECTED = 'connected',
INVALID = 'invalid',
}
}

/** Parameters for the `deleteCredentials` operation. */
Expand Down Expand Up @@ -5777,11 +5759,8 @@ namespace DiscoveryV1 {
* Obtain credentials for your source from the administrator of the source.
*/
credential_details?: CredentialDetails;
/** 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.
*/
status?: string;
/** Object that contains details about the status of the authentication process. */
status?: StatusDetails;
}

/** Object containing array of credential definitions. */
Expand Down Expand Up @@ -6819,6 +6798,14 @@ namespace DiscoveryV1 {
next_crawl?: string;
}

/** Object that contains details about the status of the authentication process. */
export interface StatusDetails {
/** Indicates whether the credential is accepted by the target data source. */
authentication?: boolean;
/** If `authentication` is `false`, a message describes why the authentication was unsuccessful. */
error_message?: string;
}

/** An object defining a single tokenizaion rule. */
export interface TokenDictRule {
/** The string to tokenize. */
Expand Down
16 changes: 14 additions & 2 deletions test/unit/discovery.v1.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4890,12 +4890,18 @@ describe('DiscoveryV1', () => {
secret_access_key: 'testString',
};

// StatusDetails
const statusDetailsModel = {
authentication: true,
error_message: 'testString',
};

test('should pass the right params to createRequest', () => {
// Construct the params object for operation createCredentials
const environmentId = 'testString';
const sourceType = 'box';
const credentialDetails = credentialDetailsModel;
const status = 'connected';
const status = statusDetailsModel;
const params = {
environmentId: environmentId,
sourceType: sourceType,
Expand Down Expand Up @@ -5067,13 +5073,19 @@ describe('DiscoveryV1', () => {
secret_access_key: 'testString',
};

// StatusDetails
const statusDetailsModel = {
authentication: true,
error_message: 'testString',
};

test('should pass the right params to createRequest', () => {
// Construct the params object for operation updateCredentials
const environmentId = 'testString';
const credentialId = 'testString';
const sourceType = 'box';
const credentialDetails = credentialDetailsModel;
const status = 'connected';
const status = statusDetailsModel;
const params = {
environmentId: environmentId,
credentialId: credentialId,
Expand Down

0 comments on commit bb69a7e

Please sign in to comment.