A service to manage Google Cloud support cases. v2
Package
@google-cloud/supportConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);Construct an instance of CaseServiceClient.
| Parameters | |
|---|---|
| Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof fallback
: loaded instance of |
Properties
apiEndpoint
get apiEndpoint(): string;The DNS address for this API service.
apiEndpoint
static get apiEndpoint(): string;The DNS address for this API service - same as servicePath.
auth
auth: gax.GoogleAuth;caseServiceStub
caseServiceStub?: Promise<{
[name: string]: Function;
}>;descriptors
descriptors: Descriptors;innerApiCalls
innerApiCalls: {
[name: string]: Function;
};pathTemplates
pathTemplates: {
[name: string]: gax.PathTemplate;
};port
static get port(): number;The port for this API service.
scopes
static get scopes(): string[];The scopes needed to make gRPC calls for every method defined in this service.
servicePath
static get servicePath(): string;The DNS address for this API service.
universeDomain
get universeDomain(): string;warn
warn: (code: string, message: string, warnType?: string) => void;Methods
close()
close(): Promise<void>;Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
| Returns | |
|---|---|
| Type | Description |
Promise<void> |
{Promise} A promise that resolves when the client is closed. |
closeCase(request, options)
closeCase(request?: protos.google.cloud.support.v2.ICloseCaseRequest, options?: CallOptions): Promise<[
protos.google.cloud.support.v2.ICase,
protos.google.cloud.support.v2.ICloseCaseRequest | undefined,
{} | undefined
]>;Close a case.
| Parameters | |
|---|---|
| Name | Description |
request |
ICloseCaseRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.support.v2.ICase,
protos.google.cloud.support.v2.ICloseCaseRequest | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the case to close.
*/
// const name = 'abc123'
// Imports the Support library
const {CaseServiceClient} = require('@google-cloud/support').v2;
// Instantiates a client
const supportClient = new CaseServiceClient();
async function callCloseCase() {
// Construct request
const request = {
name,
};
// Run request
const response = await supportClient.closeCase(request);
console.log(response);
}
callCloseCase();
closeCase(request, options, callback)
closeCase(request: protos.google.cloud.support.v2.ICloseCaseRequest, options: CallOptions, callback: Callback<protos.google.cloud.support.v2.ICase, protos.google.cloud.support.v2.ICloseCaseRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ICloseCaseRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.support.v2.ICase, protos.google.cloud.support.v2.ICloseCaseRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
closeCase(request, callback)
closeCase(request: protos.google.cloud.support.v2.ICloseCaseRequest, callback: Callback<protos.google.cloud.support.v2.ICase, protos.google.cloud.support.v2.ICloseCaseRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ICloseCaseRequest
|
callback |
Callback<protos.google.cloud.support.v2.ICase, protos.google.cloud.support.v2.ICloseCaseRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
createCase(request, options)
createCase(request?: protos.google.cloud.support.v2.ICreateCaseRequest, options?: CallOptions): Promise<[
protos.google.cloud.support.v2.ICase,
protos.google.cloud.support.v2.ICreateCaseRequest | undefined,
{} | undefined
]>;Create a new case and associate it with a parent.
It must have the following fields set: display_name, description, classification, and priority. If you're just testing the API and don't want to route your case to an agent, set testCase=true.
| Parameters | |
|---|---|
| Name | Description |
request |
ICreateCaseRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.support.v2.ICase,
protos.google.cloud.support.v2.ICreateCaseRequest | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the parent under which the case should be created.
*/
// const parent = 'abc123'
/**
* Required. The case to be created.
*/
// const case = {}
// Imports the Support library
const {CaseServiceClient} = require('@google-cloud/support').v2;
// Instantiates a client
const supportClient = new CaseServiceClient();
async function callCreateCase() {
// Construct request
const request = {
parent,
case,
};
// Run request
const response = await supportClient.createCase(request);
console.log(response);
}
callCreateCase();
createCase(request, options, callback)
createCase(request: protos.google.cloud.support.v2.ICreateCaseRequest, options: CallOptions, callback: Callback<protos.google.cloud.support.v2.ICase, protos.google.cloud.support.v2.ICreateCaseRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ICreateCaseRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.support.v2.ICase, protos.google.cloud.support.v2.ICreateCaseRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
createCase(request, callback)
createCase(request: protos.google.cloud.support.v2.ICreateCaseRequest, callback: Callback<protos.google.cloud.support.v2.ICase, protos.google.cloud.support.v2.ICreateCaseRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ICreateCaseRequest
|
callback |
Callback<protos.google.cloud.support.v2.ICase, protos.google.cloud.support.v2.ICreateCaseRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
escalateCase(request, options)
escalateCase(request?: protos.google.cloud.support.v2.IEscalateCaseRequest, options?: CallOptions): Promise<[
protos.google.cloud.support.v2.ICase,
protos.google.cloud.support.v2.IEscalateCaseRequest | undefined,
{} | undefined
]>;Escalate a case, starting the Google Cloud Support escalation management process.
This operation is only available for some support services. Go to https://cloud.google.com/support and look for 'Technical support escalations' in the feature list to find out which ones let you do that.
| Parameters | |
|---|---|
| Name | Description |
request |
IEscalateCaseRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.support.v2.ICase,
protos.google.cloud.support.v2.IEscalateCaseRequest | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the case to be escalated.
*/
// const name = 'abc123'
/**
* The escalation information to be sent with the escalation request.
*/
// const escalation = {}
// Imports the Support library
const {CaseServiceClient} = require('@google-cloud/support').v2;
// Instantiates a client
const supportClient = new CaseServiceClient();
async function callEscalateCase() {
// Construct request
const request = {
name,
};
// Run request
const response = await supportClient.escalateCase(request);
console.log(response);
}
callEscalateCase();
escalateCase(request, options, callback)
escalateCase(request: protos.google.cloud.support.v2.IEscalateCaseRequest, options: CallOptions, callback: Callback<protos.google.cloud.support.v2.ICase, protos.google.cloud.support.v2.IEscalateCaseRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IEscalateCaseRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.support.v2.ICase, protos.google.cloud.support.v2.IEscalateCaseRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
escalateCase(request, callback)
escalateCase(request: protos.google.cloud.support.v2.IEscalateCaseRequest, callback: Callback<protos.google.cloud.support.v2.ICase, protos.google.cloud.support.v2.IEscalateCaseRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IEscalateCaseRequest
|
callback |
Callback<protos.google.cloud.support.v2.ICase, protos.google.cloud.support.v2.IEscalateCaseRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
getCase(request, options)
getCase(request?: protos.google.cloud.support.v2.IGetCaseRequest, options?: CallOptions): Promise<[
protos.google.cloud.support.v2.ICase,
protos.google.cloud.support.v2.IGetCaseRequest | undefined,
{} | undefined
]>;Retrieve a case.
| Parameters | |
|---|---|
| Name | Description |
request |
IGetCaseRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.support.v2.ICase,
protos.google.cloud.support.v2.IGetCaseRequest | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The full name of a case to be retrieved.
*/
// const name = 'abc123'
// Imports the Support library
const {CaseServiceClient} = require('@google-cloud/support').v2;
// Instantiates a client
const supportClient = new CaseServiceClient();
async function callGetCase() {
// Construct request
const request = {
name,
};
// Run request
const response = await supportClient.getCase(request);
console.log(response);
}
callGetCase();
getCase(request, options, callback)
getCase(request: protos.google.cloud.support.v2.IGetCaseRequest, options: CallOptions, callback: Callback<protos.google.cloud.support.v2.ICase, protos.google.cloud.support.v2.IGetCaseRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IGetCaseRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.support.v2.ICase, protos.google.cloud.support.v2.IGetCaseRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
getCase(request, callback)
getCase(request: protos.google.cloud.support.v2.IGetCaseRequest, callback: Callback<protos.google.cloud.support.v2.ICase, protos.google.cloud.support.v2.IGetCaseRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IGetCaseRequest
|
callback |
Callback<protos.google.cloud.support.v2.ICase, protos.google.cloud.support.v2.IGetCaseRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
getProjectId()
getProjectId(): Promise<string>;| Returns | |
|---|---|
| Type | Description |
Promise<string> |
|
getProjectId(callback)
getProjectId(callback: Callback<string, undefined, undefined>): void;| Parameter | |
|---|---|
| Name | Description |
callback |
Callback<string, undefined, undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
initialize()
initialize(): Promise<{
[name: string]: Function;
}>;Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
| Returns | |
|---|---|
| Type | Description |
Promise<{
[name: string]: Function;
}> |
{Promise} A promise that resolves to an authenticated service stub. |
listCases(request, options)
listCases(request?: protos.google.cloud.support.v2.IListCasesRequest, options?: CallOptions): Promise<[
protos.google.cloud.support.v2.ICase[],
protos.google.cloud.support.v2.IListCasesRequest | null,
protos.google.cloud.support.v2.IListCasesResponse
]>;Retrieve all cases under a parent, but not its children.
For example, listing cases under an organization only returns the cases that are directly parented by that organization. To retrieve cases under an organization and its projects, use cases.search.
| Parameters | |
|---|---|
| Name | Description |
request |
IListCasesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.support.v2.ICase[],
protos.google.cloud.support.v2.IListCasesRequest | null,
protos.google.cloud.support.v2.IListCasesResponse
]> |
{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listCases(request, options, callback)
listCases(request: protos.google.cloud.support.v2.IListCasesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.support.v2.IListCasesRequest, protos.google.cloud.support.v2.IListCasesResponse | null | undefined, protos.google.cloud.support.v2.ICase>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IListCasesRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.support.v2.IListCasesRequest, protos.google.cloud.support.v2.IListCasesResponse | null | undefined, protos.google.cloud.support.v2.ICase>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
listCases(request, callback)
listCases(request: protos.google.cloud.support.v2.IListCasesRequest, callback: PaginationCallback<protos.google.cloud.support.v2.IListCasesRequest, protos.google.cloud.support.v2.IListCasesResponse | null | undefined, protos.google.cloud.support.v2.ICase>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IListCasesRequest
|
callback |
PaginationCallback<protos.google.cloud.support.v2.IListCasesRequest, protos.google.cloud.support.v2.IListCasesResponse | null | undefined, protos.google.cloud.support.v2.ICase>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
listCasesAsync(request, options)
listCasesAsync(request?: protos.google.cloud.support.v2.IListCasesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.support.v2.ICase>;Equivalent to listCases, but returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
| Parameters | |
|---|---|
| Name | Description |
request |
IListCasesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
AsyncIterable<protos.google.cloud.support.v2.ICase> |
{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of a parent to list cases under.
*/
// const parent = 'abc123'
/**
* An expression used to filter cases.
* If it's an empty string, then no filtering happens. Otherwise, the endpoint
* returns the cases that match the filter.
* Expressions use the following fields separated by `AND` and specified with
* `=`:
* - `state`: Can be `OPEN` or `CLOSED`.
* - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You
* can specify multiple values for priority using the `OR` operator. For
* example, `priority=P1 OR priority=P2`.
* - `creator.email`: The email address of the case creator.
* EXAMPLES:
* - `state=CLOSED`
* - `state=OPEN AND creator.email="tester@example.com"`
* - `state=OPEN AND (priority=P0 OR priority=P1)`
*/
// const filter = 'abc123'
/**
* The maximum number of cases fetched with each request. Defaults to 10.
*/
// const pageSize = 1234
/**
* A token identifying the page of results to return. If unspecified, the
* first page is retrieved.
*/
// const pageToken = 'abc123'
// Imports the Support library
const {CaseServiceClient} = require('@google-cloud/support').v2;
// Instantiates a client
const supportClient = new CaseServiceClient();
async function callListCases() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = supportClient.listCasesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListCases();
listCasesStream(request, options)
listCasesStream(request?: protos.google.cloud.support.v2.IListCasesRequest, options?: CallOptions): Transform;Equivalent to listCases, but returns a NodeJS Stream object.
| Parameters | |
|---|---|
| Name | Description |
request |
IListCasesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Transform |
{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
matchAttachmentIdFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName)
matchAttachmentIdFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string): string | number;Parse the attachment_id from OrganizationCaseAttachmentId resource.
| Parameter | |
|---|---|
| Name | Description |
organizationCaseAttachmentIdName |
string
A fully-qualified path representing organization_case_attachment_id resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the attachment_id. |
matchAttachmentIdFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName)
matchAttachmentIdFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string): string | number;Parse the attachment_id from ProjectCaseAttachmentId resource.
| Parameter | |
|---|---|
| Name | Description |
projectCaseAttachmentIdName |
string
A fully-qualified path representing project_case_attachment_id resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the attachment_id. |
matchCaseFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName)
matchCaseFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string): string | number;Parse the case from OrganizationCaseAttachmentId resource.
| Parameter | |
|---|---|
| Name | Description |
organizationCaseAttachmentIdName |
string
A fully-qualified path representing organization_case_attachment_id resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the case. |
matchCaseFromOrganizationCaseCommentName(organizationCaseCommentName)
matchCaseFromOrganizationCaseCommentName(organizationCaseCommentName: string): string | number;Parse the case from OrganizationCaseComment resource.
| Parameter | |
|---|---|
| Name | Description |
organizationCaseCommentName |
string
A fully-qualified path representing organization_case_comment resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the case. |
matchCaseFromOrganizationCaseName(organizationCaseName)
matchCaseFromOrganizationCaseName(organizationCaseName: string): string | number;Parse the case from OrganizationCase resource.
| Parameter | |
|---|---|
| Name | Description |
organizationCaseName |
string
A fully-qualified path representing organization_case resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the case. |
matchCaseFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName)
matchCaseFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string): string | number;Parse the case from ProjectCaseAttachmentId resource.
| Parameter | |
|---|---|
| Name | Description |
projectCaseAttachmentIdName |
string
A fully-qualified path representing project_case_attachment_id resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the case. |
matchCaseFromProjectCaseCommentName(projectCaseCommentName)
matchCaseFromProjectCaseCommentName(projectCaseCommentName: string): string | number;Parse the case from ProjectCaseComment resource.
| Parameter | |
|---|---|
| Name | Description |
projectCaseCommentName |
string
A fully-qualified path representing project_case_comment resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the case. |
matchCaseFromProjectCaseName(projectCaseName)
matchCaseFromProjectCaseName(projectCaseName: string): string | number;Parse the case from ProjectCase resource.
| Parameter | |
|---|---|
| Name | Description |
projectCaseName |
string
A fully-qualified path representing project_case resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the case. |
matchCommentFromOrganizationCaseCommentName(organizationCaseCommentName)
matchCommentFromOrganizationCaseCommentName(organizationCaseCommentName: string): string | number;Parse the comment from OrganizationCaseComment resource.
| Parameter | |
|---|---|
| Name | Description |
organizationCaseCommentName |
string
A fully-qualified path representing organization_case_comment resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the comment. |
matchCommentFromProjectCaseCommentName(projectCaseCommentName)
matchCommentFromProjectCaseCommentName(projectCaseCommentName: string): string | number;Parse the comment from ProjectCaseComment resource.
| Parameter | |
|---|---|
| Name | Description |
projectCaseCommentName |
string
A fully-qualified path representing project_case_comment resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the comment. |
matchOrganizationFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName)
matchOrganizationFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string): string | number;Parse the organization from OrganizationCaseAttachmentId resource.
| Parameter | |
|---|---|
| Name | Description |
organizationCaseAttachmentIdName |
string
A fully-qualified path representing organization_case_attachment_id resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the organization. |
matchOrganizationFromOrganizationCaseCommentName(organizationCaseCommentName)
matchOrganizationFromOrganizationCaseCommentName(organizationCaseCommentName: string): string | number;Parse the organization from OrganizationCaseComment resource.
| Parameter | |
|---|---|
| Name | Description |
organizationCaseCommentName |
string
A fully-qualified path representing organization_case_comment resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the organization. |
matchOrganizationFromOrganizationCaseName(organizationCaseName)
matchOrganizationFromOrganizationCaseName(organizationCaseName: string): string | number;Parse the organization from OrganizationCase resource.
| Parameter | |
|---|---|
| Name | Description |
organizationCaseName |
string
A fully-qualified path representing organization_case resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the organization. |
matchOrganizationFromOrganizationName(organizationName)
matchOrganizationFromOrganizationName(organizationName: string): string | number;Parse the organization from Organization resource.
| Parameter | |
|---|---|
| Name | Description |
organizationName |
string
A fully-qualified path representing Organization resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the organization. |
matchOrganizationFromSupportEventSubscriptionName(supportEventSubscriptionName)
matchOrganizationFromSupportEventSubscriptionName(supportEventSubscriptionName: string): string | number;Parse the organization from SupportEventSubscription resource.
| Parameter | |
|---|---|
| Name | Description |
supportEventSubscriptionName |
string
A fully-qualified path representing SupportEventSubscription resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the organization. |
matchProjectFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName)
matchProjectFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string): string | number;Parse the project from ProjectCaseAttachmentId resource.
| Parameter | |
|---|---|
| Name | Description |
projectCaseAttachmentIdName |
string
A fully-qualified path representing project_case_attachment_id resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromProjectCaseCommentName(projectCaseCommentName)
matchProjectFromProjectCaseCommentName(projectCaseCommentName: string): string | number;Parse the project from ProjectCaseComment resource.
| Parameter | |
|---|---|
| Name | Description |
projectCaseCommentName |
string
A fully-qualified path representing project_case_comment resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromProjectCaseName(projectCaseName)
matchProjectFromProjectCaseName(projectCaseName: string): string | number;Parse the project from ProjectCase resource.
| Parameter | |
|---|---|
| Name | Description |
projectCaseName |
string
A fully-qualified path representing project_case resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchSupportEventSubscriptionFromSupportEventSubscriptionName(supportEventSubscriptionName)
matchSupportEventSubscriptionFromSupportEventSubscriptionName(supportEventSubscriptionName: string): string | number;Parse the support_event_subscription from SupportEventSubscription resource.
| Parameter | |
|---|---|
| Name | Description |
supportEventSubscriptionName |
string
A fully-qualified path representing SupportEventSubscription resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the support_event_subscription. |
organizationCaseAttachmentIdPath(organization, caseParam, attachmentId)
organizationCaseAttachmentIdPath(organization: string, caseParam: string, attachmentId: string): string;Return a fully-qualified organizationCaseAttachmentId resource name string.
| Parameters | |
|---|---|
| Name | Description |
organization |
string
|
caseParam |
string
|
attachmentId |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
organizationCaseCommentPath(organization, caseParam, comment)
organizationCaseCommentPath(organization: string, caseParam: string, comment: string): string;Return a fully-qualified organizationCaseComment resource name string.
| Parameters | |
|---|---|
| Name | Description |
organization |
string
|
caseParam |
string
|
comment |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
organizationCasePath(organization, caseParam)
organizationCasePath(organization: string, caseParam: string): string;Return a fully-qualified organizationCase resource name string.
| Parameters | |
|---|---|
| Name | Description |
organization |
string
|
caseParam |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
organizationPath(organization)
organizationPath(organization: string): string;Return a fully-qualified organization resource name string.
| Parameter | |
|---|---|
| Name | Description |
organization |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
projectCaseAttachmentIdPath(project, caseParam, attachmentId)
projectCaseAttachmentIdPath(project: string, caseParam: string, attachmentId: string): string;Return a fully-qualified projectCaseAttachmentId resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
caseParam |
string
|
attachmentId |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
projectCaseCommentPath(project, caseParam, comment)
projectCaseCommentPath(project: string, caseParam: string, comment: string): string;Return a fully-qualified projectCaseComment resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
caseParam |
string
|
comment |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
projectCasePath(project, caseParam)
projectCasePath(project: string, caseParam: string): string;Return a fully-qualified projectCase resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
caseParam |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
searchCaseClassifications(request, options)
searchCaseClassifications(request?: protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, options?: CallOptions): Promise<[
protos.google.cloud.support.v2.ICaseClassification[],
protos.google.cloud.support.v2.ISearchCaseClassificationsRequest | null,
protos.google.cloud.support.v2.ISearchCaseClassificationsResponse
]>;Retrieve valid classifications to use when creating a support case.
Classifications are hierarchical. Each classification is a string containing all levels of the hierarchy separated by " > ". For example, "Technical Issue > Compute > Compute Engine".
Classification IDs returned by this endpoint are valid for at least six months. When a classification is deactivated, this endpoint immediately stops returning it. After six months, case.create requests using the classification will fail.
| Parameters | |
|---|---|
| Name | Description |
request |
ISearchCaseClassificationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.support.v2.ICaseClassification[],
protos.google.cloud.support.v2.ISearchCaseClassificationsRequest | null,
protos.google.cloud.support.v2.ISearchCaseClassificationsResponse
]> |
{Promise} - The promise which resolves to an array. The first element of the array is Array of CaseClassification. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
searchCaseClassifications(request, options, callback)
searchCaseClassifications(request: protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, protos.google.cloud.support.v2.ISearchCaseClassificationsResponse | null | undefined, protos.google.cloud.support.v2.ICaseClassification>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ISearchCaseClassificationsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, protos.google.cloud.support.v2.ISearchCaseClassificationsResponse | null | undefined, protos.google.cloud.support.v2.ICaseClassification>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
searchCaseClassifications(request, callback)
searchCaseClassifications(request: protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, callback: PaginationCallback<protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, protos.google.cloud.support.v2.ISearchCaseClassificationsResponse | null | undefined, protos.google.cloud.support.v2.ICaseClassification>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ISearchCaseClassificationsRequest
|
callback |
PaginationCallback<protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, protos.google.cloud.support.v2.ISearchCaseClassificationsResponse | null | undefined, protos.google.cloud.support.v2.ICaseClassification>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
searchCaseClassificationsAsync(request, options)
searchCaseClassificationsAsync(request?: protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.support.v2.ICaseClassification>;Equivalent to searchCaseClassifications, but returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
| Parameters | |
|---|---|
| Name | Description |
request |
ISearchCaseClassificationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
AsyncIterable<protos.google.cloud.support.v2.ICaseClassification> |
{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing CaseClassification. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* An expression used to filter case classifications.
* If it's an empty string, then no filtering happens. Otherwise, case
* classifications will be returned that match the filter.
*/
// const query = 'abc123'
/**
* The maximum number of classifications fetched with each request.
*/
// const pageSize = 1234
/**
* A token identifying the page of results to return. If unspecified, the
* first page is retrieved.
*/
// const pageToken = 'abc123'
// Imports the Support library
const {CaseServiceClient} = require('@google-cloud/support').v2;
// Instantiates a client
const supportClient = new CaseServiceClient();
async function callSearchCaseClassifications() {
// Construct request
const request = {
};
// Run request
const iterable = supportClient.searchCaseClassificationsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callSearchCaseClassifications();
searchCaseClassificationsStream(request, options)
searchCaseClassificationsStream(request?: protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, options?: CallOptions): Transform;Equivalent to searchCaseClassifications, but returns a NodeJS Stream object.
| Parameters | |
|---|---|
| Name | Description |
request |
ISearchCaseClassificationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Transform |
{Stream} An object stream which emits an object representing CaseClassification on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
searchCases(request, options)
searchCases(request?: protos.google.cloud.support.v2.ISearchCasesRequest, options?: CallOptions): Promise<[
protos.google.cloud.support.v2.ICase[],
protos.google.cloud.support.v2.ISearchCasesRequest | null,
protos.google.cloud.support.v2.ISearchCasesResponse
]>;Search for cases using a query.
| Parameters | |
|---|---|
| Name | Description |
request |
ISearchCasesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.support.v2.ICase[],
protos.google.cloud.support.v2.ISearchCasesRequest | null,
protos.google.cloud.support.v2.ISearchCasesResponse
]> |
{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
searchCases(request, options, callback)
searchCases(request: protos.google.cloud.support.v2.ISearchCasesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.support.v2.ISearchCasesRequest, protos.google.cloud.support.v2.ISearchCasesResponse | null | undefined, protos.google.cloud.support.v2.ICase>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ISearchCasesRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.support.v2.ISearchCasesRequest, protos.google.cloud.support.v2.ISearchCasesResponse | null | undefined, protos.google.cloud.support.v2.ICase>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
searchCases(request, callback)
searchCases(request: protos.google.cloud.support.v2.ISearchCasesRequest, callback: PaginationCallback<protos.google.cloud.support.v2.ISearchCasesRequest, protos.google.cloud.support.v2.ISearchCasesResponse | null | undefined, protos.google.cloud.support.v2.ICase>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ISearchCasesRequest
|
callback |
PaginationCallback<protos.google.cloud.support.v2.ISearchCasesRequest, protos.google.cloud.support.v2.ISearchCasesResponse | null | undefined, protos.google.cloud.support.v2.ICase>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
searchCasesAsync(request, options)
searchCasesAsync(request?: protos.google.cloud.support.v2.ISearchCasesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.support.v2.ICase>;Equivalent to searchCases, but returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
| Parameters | |
|---|---|
| Name | Description |
request |
ISearchCasesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
AsyncIterable<protos.google.cloud.support.v2.ICase> |
{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The name of the parent resource to search for cases under.
*/
// const parent = 'abc123'
/**
* An expression used to filter cases.
* Expressions use the following fields separated by `AND` and specified with
* `=`:
* - `state`: Can be `OPEN` or `CLOSED`.
* - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You
* can specify multiple values for priority using the `OR` operator. For
* example, `priority=P1 OR priority=P2`.
* - `creator.email`: The email address of the case creator.
* To search across `displayName`, `description`, and comments, use a global
* restriction with no keyword or operator. For example, `"my search"`.
* To search only cases updated after a certain date, use `update_time`
* restricted with that particular date, time, and timezone in ISO datetime
* format. For example, `update_time>"2020-01-01T00:00:00-05:00"`.
* `update_time` only supports the greater than operator (`>`).
* If you are using the `v2` version of the API, you must specify the case
* parent in the `parent` field. If you provide an empty `query`, all cases
* under the parent resource will be returned.
* If you are using the `v2beta` version of the API, you must specify the case
* parent in the `query` field using one of the two fields below, which are
* only available for `v2beta`. The `parent` field will be ignored.
* - `organization`: An organization name in the form
* `organizations/searchCasesStream(request, options)
searchCasesStream(request?: protos.google.cloud.support.v2.ISearchCasesRequest, options?: CallOptions): Transform;Equivalent to searchCases, but returns a NodeJS Stream object.
| Parameters | |
|---|---|
| Name | Description |
request |
ISearchCasesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Transform |
{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
supportEventSubscriptionPath(organization, supportEventSubscription)
supportEventSubscriptionPath(organization: string, supportEventSubscription: string): string;Return a fully-qualified supportEventSubscription resource name string.
| Parameters | |
|---|---|
| Name | Description |
organization |
string
|
supportEventSubscription |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
updateCase(request, options)
updateCase(request?: protos.google.cloud.support.v2.IUpdateCaseRequest, options?: CallOptions): Promise<[
protos.google.cloud.support.v2.ICase,
protos.google.cloud.support.v2.IUpdateCaseRequest | undefined,
{} | undefined
]>;Update a case. Only some fields can be updated.
| Parameters | |
|---|---|
| Name | Description |
request |
IUpdateCaseRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.support.v2.ICase,
protos.google.cloud.support.v2.IUpdateCaseRequest | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The case to update.
*/
// const case = {}
/**
* A list of attributes of the case that should be updated. Supported values
* are `priority`, `display_name`, and `subscriber_email_addresses`. If no
* fields are specified, all supported fields are updated.
* Be careful - if you do not provide a field mask, then you might
* accidentally clear some fields. For example, if you leave the field mask
* empty and do not provide a value for `subscriber_email_addresses`, then
* `subscriber_email_addresses` is updated to empty.
*/
// const updateMask = {}
// Imports the Support library
const {CaseServiceClient} = require('@google-cloud/support').v2;
// Instantiates a client
const supportClient = new CaseServiceClient();
async function callUpdateCase() {
// Construct request
const request = {
case,
};
// Run request
const response = await supportClient.updateCase(request);
console.log(response);
}
callUpdateCase();
updateCase(request, options, callback)
updateCase(request: protos.google.cloud.support.v2.IUpdateCaseRequest, options: CallOptions, callback: Callback<protos.google.cloud.support.v2.ICase, protos.google.cloud.support.v2.IUpdateCaseRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IUpdateCaseRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.support.v2.ICase, protos.google.cloud.support.v2.IUpdateCaseRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
updateCase(request, callback)
updateCase(request: protos.google.cloud.support.v2.IUpdateCaseRequest, callback: Callback<protos.google.cloud.support.v2.ICase, protos.google.cloud.support.v2.IUpdateCaseRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IUpdateCaseRequest
|
callback |
Callback<protos.google.cloud.support.v2.ICase, protos.google.cloud.support.v2.IUpdateCaseRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|