@google-cloud/logging
Advanced tools
Comparing version 5.1.3 to 5.2.0
@@ -104,5 +104,30 @@ // Copyright 2019 Google LLC | ||
this._pathTemplates = { | ||
billingPathTemplate: new gax.PathTemplate( | ||
'billingAccounts/{billing_account}' | ||
), | ||
billingExclusionPathTemplate: new gax.PathTemplate( | ||
'billingAccounts/{billing_account}/exclusions/{exclusion}' | ||
), | ||
billingSinkPathTemplate: new gax.PathTemplate( | ||
'billingAccounts/{billing_account}/sinks/{sink}' | ||
), | ||
exclusionPathTemplate: new gax.PathTemplate( | ||
'projects/{project}/exclusions/{exclusion}' | ||
), | ||
folderPathTemplate: new gax.PathTemplate('folders/{folder}'), | ||
folderExclusionPathTemplate: new gax.PathTemplate( | ||
'folders/{folder}/exclusions/{exclusion}' | ||
), | ||
folderSinkPathTemplate: new gax.PathTemplate( | ||
'folders/{folder}/sinks/{sink}' | ||
), | ||
organizationPathTemplate: new gax.PathTemplate( | ||
'organizations/{organization}' | ||
), | ||
organizationExclusionPathTemplate: new gax.PathTemplate( | ||
'organizations/{organization}/exclusions/{exclusion}' | ||
), | ||
organizationSinkPathTemplate: new gax.PathTemplate( | ||
'organizations/{organization}/sinks/{sink}' | ||
), | ||
projectPathTemplate: new gax.PathTemplate('projects/{project}'), | ||
@@ -1134,2 +1159,42 @@ sinkPathTemplate: new gax.PathTemplate('projects/{project}/sinks/{sink}'), | ||
/** | ||
* Return a fully-qualified billing resource name string. | ||
* | ||
* @param {String} billingAccount | ||
* @returns {String} | ||
*/ | ||
billingPath(billingAccount) { | ||
return this._pathTemplates.billingPathTemplate.render({ | ||
billing_account: billingAccount, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified billing_exclusion resource name string. | ||
* | ||
* @param {String} billingAccount | ||
* @param {String} exclusion | ||
* @returns {String} | ||
*/ | ||
billingExclusionPath(billingAccount, exclusion) { | ||
return this._pathTemplates.billingExclusionPathTemplate.render({ | ||
billing_account: billingAccount, | ||
exclusion: exclusion, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified billing_sink resource name string. | ||
* | ||
* @param {String} billingAccount | ||
* @param {String} sink | ||
* @returns {String} | ||
*/ | ||
billingSinkPath(billingAccount, sink) { | ||
return this._pathTemplates.billingSinkPathTemplate.render({ | ||
billing_account: billingAccount, | ||
sink: sink, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified exclusion resource name string. | ||
@@ -1149,2 +1214,82 @@ * | ||
/** | ||
* Return a fully-qualified folder resource name string. | ||
* | ||
* @param {String} folder | ||
* @returns {String} | ||
*/ | ||
folderPath(folder) { | ||
return this._pathTemplates.folderPathTemplate.render({ | ||
folder: folder, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified folder_exclusion resource name string. | ||
* | ||
* @param {String} folder | ||
* @param {String} exclusion | ||
* @returns {String} | ||
*/ | ||
folderExclusionPath(folder, exclusion) { | ||
return this._pathTemplates.folderExclusionPathTemplate.render({ | ||
folder: folder, | ||
exclusion: exclusion, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified folder_sink resource name string. | ||
* | ||
* @param {String} folder | ||
* @param {String} sink | ||
* @returns {String} | ||
*/ | ||
folderSinkPath(folder, sink) { | ||
return this._pathTemplates.folderSinkPathTemplate.render({ | ||
folder: folder, | ||
sink: sink, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified organization resource name string. | ||
* | ||
* @param {String} organization | ||
* @returns {String} | ||
*/ | ||
organizationPath(organization) { | ||
return this._pathTemplates.organizationPathTemplate.render({ | ||
organization: organization, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified organization_exclusion resource name string. | ||
* | ||
* @param {String} organization | ||
* @param {String} exclusion | ||
* @returns {String} | ||
*/ | ||
organizationExclusionPath(organization, exclusion) { | ||
return this._pathTemplates.organizationExclusionPathTemplate.render({ | ||
organization: organization, | ||
exclusion: exclusion, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified organization_sink resource name string. | ||
* | ||
* @param {String} organization | ||
* @param {String} sink | ||
* @returns {String} | ||
*/ | ||
organizationSinkPath(organization, sink) { | ||
return this._pathTemplates.organizationSinkPathTemplate.render({ | ||
organization: organization, | ||
sink: sink, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified project resource name string. | ||
@@ -1176,2 +1321,64 @@ * | ||
/** | ||
* Parse the billingName from a billing resource. | ||
* | ||
* @param {String} billingName | ||
* A fully-qualified path representing a billing resources. | ||
* @returns {String} - A string representing the billing_account. | ||
*/ | ||
matchBillingAccountFromBillingName(billingName) { | ||
return this._pathTemplates.billingPathTemplate.match(billingName) | ||
.billing_account; | ||
} | ||
/** | ||
* Parse the billingExclusionName from a billing_exclusion resource. | ||
* | ||
* @param {String} billingExclusionName | ||
* A fully-qualified path representing a billing_exclusion resources. | ||
* @returns {String} - A string representing the billing_account. | ||
*/ | ||
matchBillingAccountFromBillingExclusionName(billingExclusionName) { | ||
return this._pathTemplates.billingExclusionPathTemplate.match( | ||
billingExclusionName | ||
).billing_account; | ||
} | ||
/** | ||
* Parse the billingExclusionName from a billing_exclusion resource. | ||
* | ||
* @param {String} billingExclusionName | ||
* A fully-qualified path representing a billing_exclusion resources. | ||
* @returns {String} - A string representing the exclusion. | ||
*/ | ||
matchExclusionFromBillingExclusionName(billingExclusionName) { | ||
return this._pathTemplates.billingExclusionPathTemplate.match( | ||
billingExclusionName | ||
).exclusion; | ||
} | ||
/** | ||
* Parse the billingSinkName from a billing_sink resource. | ||
* | ||
* @param {String} billingSinkName | ||
* A fully-qualified path representing a billing_sink resources. | ||
* @returns {String} - A string representing the billing_account. | ||
*/ | ||
matchBillingAccountFromBillingSinkName(billingSinkName) { | ||
return this._pathTemplates.billingSinkPathTemplate.match(billingSinkName) | ||
.billing_account; | ||
} | ||
/** | ||
* Parse the billingSinkName from a billing_sink resource. | ||
* | ||
* @param {String} billingSinkName | ||
* A fully-qualified path representing a billing_sink resources. | ||
* @returns {String} - A string representing the sink. | ||
*/ | ||
matchSinkFromBillingSinkName(billingSinkName) { | ||
return this._pathTemplates.billingSinkPathTemplate.match(billingSinkName) | ||
.sink; | ||
} | ||
/** | ||
* Parse the exclusionName from a exclusion resource. | ||
@@ -1201,2 +1408,127 @@ * | ||
/** | ||
* Parse the folderName from a folder resource. | ||
* | ||
* @param {String} folderName | ||
* A fully-qualified path representing a folder resources. | ||
* @returns {String} - A string representing the folder. | ||
*/ | ||
matchFolderFromFolderName(folderName) { | ||
return this._pathTemplates.folderPathTemplate.match(folderName).folder; | ||
} | ||
/** | ||
* Parse the folderExclusionName from a folder_exclusion resource. | ||
* | ||
* @param {String} folderExclusionName | ||
* A fully-qualified path representing a folder_exclusion resources. | ||
* @returns {String} - A string representing the folder. | ||
*/ | ||
matchFolderFromFolderExclusionName(folderExclusionName) { | ||
return this._pathTemplates.folderExclusionPathTemplate.match( | ||
folderExclusionName | ||
).folder; | ||
} | ||
/** | ||
* Parse the folderExclusionName from a folder_exclusion resource. | ||
* | ||
* @param {String} folderExclusionName | ||
* A fully-qualified path representing a folder_exclusion resources. | ||
* @returns {String} - A string representing the exclusion. | ||
*/ | ||
matchExclusionFromFolderExclusionName(folderExclusionName) { | ||
return this._pathTemplates.folderExclusionPathTemplate.match( | ||
folderExclusionName | ||
).exclusion; | ||
} | ||
/** | ||
* Parse the folderSinkName from a folder_sink resource. | ||
* | ||
* @param {String} folderSinkName | ||
* A fully-qualified path representing a folder_sink resources. | ||
* @returns {String} - A string representing the folder. | ||
*/ | ||
matchFolderFromFolderSinkName(folderSinkName) { | ||
return this._pathTemplates.folderSinkPathTemplate.match(folderSinkName) | ||
.folder; | ||
} | ||
/** | ||
* Parse the folderSinkName from a folder_sink resource. | ||
* | ||
* @param {String} folderSinkName | ||
* A fully-qualified path representing a folder_sink resources. | ||
* @returns {String} - A string representing the sink. | ||
*/ | ||
matchSinkFromFolderSinkName(folderSinkName) { | ||
return this._pathTemplates.folderSinkPathTemplate.match(folderSinkName) | ||
.sink; | ||
} | ||
/** | ||
* Parse the organizationName from a organization resource. | ||
* | ||
* @param {String} organizationName | ||
* A fully-qualified path representing a organization resources. | ||
* @returns {String} - A string representing the organization. | ||
*/ | ||
matchOrganizationFromOrganizationName(organizationName) { | ||
return this._pathTemplates.organizationPathTemplate.match(organizationName) | ||
.organization; | ||
} | ||
/** | ||
* Parse the organizationExclusionName from a organization_exclusion resource. | ||
* | ||
* @param {String} organizationExclusionName | ||
* A fully-qualified path representing a organization_exclusion resources. | ||
* @returns {String} - A string representing the organization. | ||
*/ | ||
matchOrganizationFromOrganizationExclusionName(organizationExclusionName) { | ||
return this._pathTemplates.organizationExclusionPathTemplate.match( | ||
organizationExclusionName | ||
).organization; | ||
} | ||
/** | ||
* Parse the organizationExclusionName from a organization_exclusion resource. | ||
* | ||
* @param {String} organizationExclusionName | ||
* A fully-qualified path representing a organization_exclusion resources. | ||
* @returns {String} - A string representing the exclusion. | ||
*/ | ||
matchExclusionFromOrganizationExclusionName(organizationExclusionName) { | ||
return this._pathTemplates.organizationExclusionPathTemplate.match( | ||
organizationExclusionName | ||
).exclusion; | ||
} | ||
/** | ||
* Parse the organizationSinkName from a organization_sink resource. | ||
* | ||
* @param {String} organizationSinkName | ||
* A fully-qualified path representing a organization_sink resources. | ||
* @returns {String} - A string representing the organization. | ||
*/ | ||
matchOrganizationFromOrganizationSinkName(organizationSinkName) { | ||
return this._pathTemplates.organizationSinkPathTemplate.match( | ||
organizationSinkName | ||
).organization; | ||
} | ||
/** | ||
* Parse the organizationSinkName from a organization_sink resource. | ||
* | ||
* @param {String} organizationSinkName | ||
* A fully-qualified path representing a organization_sink resources. | ||
* @returns {String} - A string representing the sink. | ||
*/ | ||
matchSinkFromOrganizationSinkName(organizationSinkName) { | ||
return this._pathTemplates.organizationSinkPathTemplate.match( | ||
organizationSinkName | ||
).sink; | ||
} | ||
/** | ||
* Parse the projectName from a project resource. | ||
@@ -1203,0 +1535,0 @@ * |
@@ -104,3 +104,19 @@ // Copyright 2019 Google LLC | ||
this._pathTemplates = { | ||
billingPathTemplate: new gax.PathTemplate( | ||
'billingAccounts/{billing_account}' | ||
), | ||
billingLogPathTemplate: new gax.PathTemplate( | ||
'billingAccounts/{billing_account}/logs/{log}' | ||
), | ||
folderPathTemplate: new gax.PathTemplate('folders/{folder}'), | ||
folderLogPathTemplate: new gax.PathTemplate( | ||
'folders/{folder}/logs/{log}' | ||
), | ||
logPathTemplate: new gax.PathTemplate('projects/{project}/logs/{log}'), | ||
organizationPathTemplate: new gax.PathTemplate( | ||
'organizations/{organization}' | ||
), | ||
organizationLogPathTemplate: new gax.PathTemplate( | ||
'organizations/{organization}/logs/{log}' | ||
), | ||
projectPathTemplate: new gax.PathTemplate('projects/{project}'), | ||
@@ -957,2 +973,54 @@ }; | ||
/** | ||
* Return a fully-qualified billing resource name string. | ||
* | ||
* @param {String} billingAccount | ||
* @returns {String} | ||
*/ | ||
billingPath(billingAccount) { | ||
return this._pathTemplates.billingPathTemplate.render({ | ||
billing_account: billingAccount, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified billing_log resource name string. | ||
* | ||
* @param {String} billingAccount | ||
* @param {String} log | ||
* @returns {String} | ||
*/ | ||
billingLogPath(billingAccount, log) { | ||
return this._pathTemplates.billingLogPathTemplate.render({ | ||
billing_account: billingAccount, | ||
log: log, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified folder resource name string. | ||
* | ||
* @param {String} folder | ||
* @returns {String} | ||
*/ | ||
folderPath(folder) { | ||
return this._pathTemplates.folderPathTemplate.render({ | ||
folder: folder, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified folder_log resource name string. | ||
* | ||
* @param {String} folder | ||
* @param {String} log | ||
* @returns {String} | ||
*/ | ||
folderLogPath(folder, log) { | ||
return this._pathTemplates.folderLogPathTemplate.render({ | ||
folder: folder, | ||
log: log, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified log resource name string. | ||
@@ -972,2 +1040,28 @@ * | ||
/** | ||
* Return a fully-qualified organization resource name string. | ||
* | ||
* @param {String} organization | ||
* @returns {String} | ||
*/ | ||
organizationPath(organization) { | ||
return this._pathTemplates.organizationPathTemplate.render({ | ||
organization: organization, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified organization_log resource name string. | ||
* | ||
* @param {String} organization | ||
* @param {String} log | ||
* @returns {String} | ||
*/ | ||
organizationLogPath(organization, log) { | ||
return this._pathTemplates.organizationLogPathTemplate.render({ | ||
organization: organization, | ||
log: log, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified project resource name string. | ||
@@ -985,2 +1079,71 @@ * | ||
/** | ||
* Parse the billingName from a billing resource. | ||
* | ||
* @param {String} billingName | ||
* A fully-qualified path representing a billing resources. | ||
* @returns {String} - A string representing the billing_account. | ||
*/ | ||
matchBillingAccountFromBillingName(billingName) { | ||
return this._pathTemplates.billingPathTemplate.match(billingName) | ||
.billing_account; | ||
} | ||
/** | ||
* Parse the billingLogName from a billing_log resource. | ||
* | ||
* @param {String} billingLogName | ||
* A fully-qualified path representing a billing_log resources. | ||
* @returns {String} - A string representing the billing_account. | ||
*/ | ||
matchBillingAccountFromBillingLogName(billingLogName) { | ||
return this._pathTemplates.billingLogPathTemplate.match(billingLogName) | ||
.billing_account; | ||
} | ||
/** | ||
* Parse the billingLogName from a billing_log resource. | ||
* | ||
* @param {String} billingLogName | ||
* A fully-qualified path representing a billing_log resources. | ||
* @returns {String} - A string representing the log. | ||
*/ | ||
matchLogFromBillingLogName(billingLogName) { | ||
return this._pathTemplates.billingLogPathTemplate.match(billingLogName).log; | ||
} | ||
/** | ||
* Parse the folderName from a folder resource. | ||
* | ||
* @param {String} folderName | ||
* A fully-qualified path representing a folder resources. | ||
* @returns {String} - A string representing the folder. | ||
*/ | ||
matchFolderFromFolderName(folderName) { | ||
return this._pathTemplates.folderPathTemplate.match(folderName).folder; | ||
} | ||
/** | ||
* Parse the folderLogName from a folder_log resource. | ||
* | ||
* @param {String} folderLogName | ||
* A fully-qualified path representing a folder_log resources. | ||
* @returns {String} - A string representing the folder. | ||
*/ | ||
matchFolderFromFolderLogName(folderLogName) { | ||
return this._pathTemplates.folderLogPathTemplate.match(folderLogName) | ||
.folder; | ||
} | ||
/** | ||
* Parse the folderLogName from a folder_log resource. | ||
* | ||
* @param {String} folderLogName | ||
* A fully-qualified path representing a folder_log resources. | ||
* @returns {String} - A string representing the log. | ||
*/ | ||
matchLogFromFolderLogName(folderLogName) { | ||
return this._pathTemplates.folderLogPathTemplate.match(folderLogName).log; | ||
} | ||
/** | ||
* Parse the logName from a log resource. | ||
@@ -1008,2 +1171,40 @@ * | ||
/** | ||
* Parse the organizationName from a organization resource. | ||
* | ||
* @param {String} organizationName | ||
* A fully-qualified path representing a organization resources. | ||
* @returns {String} - A string representing the organization. | ||
*/ | ||
matchOrganizationFromOrganizationName(organizationName) { | ||
return this._pathTemplates.organizationPathTemplate.match(organizationName) | ||
.organization; | ||
} | ||
/** | ||
* Parse the organizationLogName from a organization_log resource. | ||
* | ||
* @param {String} organizationLogName | ||
* A fully-qualified path representing a organization_log resources. | ||
* @returns {String} - A string representing the organization. | ||
*/ | ||
matchOrganizationFromOrganizationLogName(organizationLogName) { | ||
return this._pathTemplates.organizationLogPathTemplate.match( | ||
organizationLogName | ||
).organization; | ||
} | ||
/** | ||
* Parse the organizationLogName from a organization_log resource. | ||
* | ||
* @param {String} organizationLogName | ||
* A fully-qualified path representing a organization_log resources. | ||
* @returns {String} - A string representing the log. | ||
*/ | ||
matchLogFromOrganizationLogName(organizationLogName) { | ||
return this._pathTemplates.organizationLogPathTemplate.match( | ||
organizationLogName | ||
).log; | ||
} | ||
/** | ||
* Parse the projectName from a project resource. | ||
@@ -1010,0 +1211,0 @@ * |
@@ -103,5 +103,12 @@ // Copyright 2019 Google LLC | ||
this._pathTemplates = { | ||
billingPathTemplate: new gax.PathTemplate( | ||
'billingAccounts/{billing_account}' | ||
), | ||
folderPathTemplate: new gax.PathTemplate('folders/{folder}'), | ||
metricPathTemplate: new gax.PathTemplate( | ||
'projects/{project}/metrics/{metric}' | ||
), | ||
organizationPathTemplate: new gax.PathTemplate( | ||
'organizations/{organization}' | ||
), | ||
projectPathTemplate: new gax.PathTemplate('projects/{project}'), | ||
@@ -620,2 +627,26 @@ }; | ||
/** | ||
* Return a fully-qualified billing resource name string. | ||
* | ||
* @param {String} billingAccount | ||
* @returns {String} | ||
*/ | ||
billingPath(billingAccount) { | ||
return this._pathTemplates.billingPathTemplate.render({ | ||
billing_account: billingAccount, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified folder resource name string. | ||
* | ||
* @param {String} folder | ||
* @returns {String} | ||
*/ | ||
folderPath(folder) { | ||
return this._pathTemplates.folderPathTemplate.render({ | ||
folder: folder, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified metric resource name string. | ||
@@ -635,2 +666,14 @@ * | ||
/** | ||
* Return a fully-qualified organization resource name string. | ||
* | ||
* @param {String} organization | ||
* @returns {String} | ||
*/ | ||
organizationPath(organization) { | ||
return this._pathTemplates.organizationPathTemplate.render({ | ||
organization: organization, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified project resource name string. | ||
@@ -648,2 +691,25 @@ * | ||
/** | ||
* Parse the billingName from a billing resource. | ||
* | ||
* @param {String} billingName | ||
* A fully-qualified path representing a billing resources. | ||
* @returns {String} - A string representing the billing_account. | ||
*/ | ||
matchBillingAccountFromBillingName(billingName) { | ||
return this._pathTemplates.billingPathTemplate.match(billingName) | ||
.billing_account; | ||
} | ||
/** | ||
* Parse the folderName from a folder resource. | ||
* | ||
* @param {String} folderName | ||
* A fully-qualified path representing a folder resources. | ||
* @returns {String} - A string representing the folder. | ||
*/ | ||
matchFolderFromFolderName(folderName) { | ||
return this._pathTemplates.folderPathTemplate.match(folderName).folder; | ||
} | ||
/** | ||
* Parse the metricName from a metric resource. | ||
@@ -671,2 +737,14 @@ * | ||
/** | ||
* Parse the organizationName from a organization resource. | ||
* | ||
* @param {String} organizationName | ||
* A fully-qualified path representing a organization resources. | ||
* @returns {String} - A string representing the organization. | ||
*/ | ||
matchOrganizationFromOrganizationName(organizationName) { | ||
return this._pathTemplates.organizationPathTemplate.match(organizationName) | ||
.organization; | ||
} | ||
/** | ||
* Parse the projectName from a project resource. | ||
@@ -673,0 +751,0 @@ * |
@@ -104,5 +104,30 @@ // Copyright 2019 Google LLC | ||
this._pathTemplates = { | ||
billingPathTemplate: new gax.PathTemplate( | ||
'billingAccounts/{billing_account}' | ||
), | ||
billingExclusionPathTemplate: new gax.PathTemplate( | ||
'billingAccounts/{billing_account}/exclusions/{exclusion}' | ||
), | ||
billingSinkPathTemplate: new gax.PathTemplate( | ||
'billingAccounts/{billing_account}/sinks/{sink}' | ||
), | ||
exclusionPathTemplate: new gax.PathTemplate( | ||
'projects/{project}/exclusions/{exclusion}' | ||
), | ||
folderPathTemplate: new gax.PathTemplate('folders/{folder}'), | ||
folderExclusionPathTemplate: new gax.PathTemplate( | ||
'folders/{folder}/exclusions/{exclusion}' | ||
), | ||
folderSinkPathTemplate: new gax.PathTemplate( | ||
'folders/{folder}/sinks/{sink}' | ||
), | ||
organizationPathTemplate: new gax.PathTemplate( | ||
'organizations/{organization}' | ||
), | ||
organizationExclusionPathTemplate: new gax.PathTemplate( | ||
'organizations/{organization}/exclusions/{exclusion}' | ||
), | ||
organizationSinkPathTemplate: new gax.PathTemplate( | ||
'organizations/{organization}/sinks/{sink}' | ||
), | ||
projectPathTemplate: new gax.PathTemplate('projects/{project}'), | ||
@@ -1134,2 +1159,42 @@ sinkPathTemplate: new gax.PathTemplate('projects/{project}/sinks/{sink}'), | ||
/** | ||
* Return a fully-qualified billing resource name string. | ||
* | ||
* @param {String} billingAccount | ||
* @returns {String} | ||
*/ | ||
billingPath(billingAccount) { | ||
return this._pathTemplates.billingPathTemplate.render({ | ||
billing_account: billingAccount, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified billing_exclusion resource name string. | ||
* | ||
* @param {String} billingAccount | ||
* @param {String} exclusion | ||
* @returns {String} | ||
*/ | ||
billingExclusionPath(billingAccount, exclusion) { | ||
return this._pathTemplates.billingExclusionPathTemplate.render({ | ||
billing_account: billingAccount, | ||
exclusion: exclusion, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified billing_sink resource name string. | ||
* | ||
* @param {String} billingAccount | ||
* @param {String} sink | ||
* @returns {String} | ||
*/ | ||
billingSinkPath(billingAccount, sink) { | ||
return this._pathTemplates.billingSinkPathTemplate.render({ | ||
billing_account: billingAccount, | ||
sink: sink, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified exclusion resource name string. | ||
@@ -1149,2 +1214,82 @@ * | ||
/** | ||
* Return a fully-qualified folder resource name string. | ||
* | ||
* @param {String} folder | ||
* @returns {String} | ||
*/ | ||
folderPath(folder) { | ||
return this._pathTemplates.folderPathTemplate.render({ | ||
folder: folder, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified folder_exclusion resource name string. | ||
* | ||
* @param {String} folder | ||
* @param {String} exclusion | ||
* @returns {String} | ||
*/ | ||
folderExclusionPath(folder, exclusion) { | ||
return this._pathTemplates.folderExclusionPathTemplate.render({ | ||
folder: folder, | ||
exclusion: exclusion, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified folder_sink resource name string. | ||
* | ||
* @param {String} folder | ||
* @param {String} sink | ||
* @returns {String} | ||
*/ | ||
folderSinkPath(folder, sink) { | ||
return this._pathTemplates.folderSinkPathTemplate.render({ | ||
folder: folder, | ||
sink: sink, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified organization resource name string. | ||
* | ||
* @param {String} organization | ||
* @returns {String} | ||
*/ | ||
organizationPath(organization) { | ||
return this._pathTemplates.organizationPathTemplate.render({ | ||
organization: organization, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified organization_exclusion resource name string. | ||
* | ||
* @param {String} organization | ||
* @param {String} exclusion | ||
* @returns {String} | ||
*/ | ||
organizationExclusionPath(organization, exclusion) { | ||
return this._pathTemplates.organizationExclusionPathTemplate.render({ | ||
organization: organization, | ||
exclusion: exclusion, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified organization_sink resource name string. | ||
* | ||
* @param {String} organization | ||
* @param {String} sink | ||
* @returns {String} | ||
*/ | ||
organizationSinkPath(organization, sink) { | ||
return this._pathTemplates.organizationSinkPathTemplate.render({ | ||
organization: organization, | ||
sink: sink, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified project resource name string. | ||
@@ -1176,2 +1321,64 @@ * | ||
/** | ||
* Parse the billingName from a billing resource. | ||
* | ||
* @param {String} billingName | ||
* A fully-qualified path representing a billing resources. | ||
* @returns {String} - A string representing the billing_account. | ||
*/ | ||
matchBillingAccountFromBillingName(billingName) { | ||
return this._pathTemplates.billingPathTemplate.match(billingName) | ||
.billing_account; | ||
} | ||
/** | ||
* Parse the billingExclusionName from a billing_exclusion resource. | ||
* | ||
* @param {String} billingExclusionName | ||
* A fully-qualified path representing a billing_exclusion resources. | ||
* @returns {String} - A string representing the billing_account. | ||
*/ | ||
matchBillingAccountFromBillingExclusionName(billingExclusionName) { | ||
return this._pathTemplates.billingExclusionPathTemplate.match( | ||
billingExclusionName | ||
).billing_account; | ||
} | ||
/** | ||
* Parse the billingExclusionName from a billing_exclusion resource. | ||
* | ||
* @param {String} billingExclusionName | ||
* A fully-qualified path representing a billing_exclusion resources. | ||
* @returns {String} - A string representing the exclusion. | ||
*/ | ||
matchExclusionFromBillingExclusionName(billingExclusionName) { | ||
return this._pathTemplates.billingExclusionPathTemplate.match( | ||
billingExclusionName | ||
).exclusion; | ||
} | ||
/** | ||
* Parse the billingSinkName from a billing_sink resource. | ||
* | ||
* @param {String} billingSinkName | ||
* A fully-qualified path representing a billing_sink resources. | ||
* @returns {String} - A string representing the billing_account. | ||
*/ | ||
matchBillingAccountFromBillingSinkName(billingSinkName) { | ||
return this._pathTemplates.billingSinkPathTemplate.match(billingSinkName) | ||
.billing_account; | ||
} | ||
/** | ||
* Parse the billingSinkName from a billing_sink resource. | ||
* | ||
* @param {String} billingSinkName | ||
* A fully-qualified path representing a billing_sink resources. | ||
* @returns {String} - A string representing the sink. | ||
*/ | ||
matchSinkFromBillingSinkName(billingSinkName) { | ||
return this._pathTemplates.billingSinkPathTemplate.match(billingSinkName) | ||
.sink; | ||
} | ||
/** | ||
* Parse the exclusionName from a exclusion resource. | ||
@@ -1201,2 +1408,127 @@ * | ||
/** | ||
* Parse the folderName from a folder resource. | ||
* | ||
* @param {String} folderName | ||
* A fully-qualified path representing a folder resources. | ||
* @returns {String} - A string representing the folder. | ||
*/ | ||
matchFolderFromFolderName(folderName) { | ||
return this._pathTemplates.folderPathTemplate.match(folderName).folder; | ||
} | ||
/** | ||
* Parse the folderExclusionName from a folder_exclusion resource. | ||
* | ||
* @param {String} folderExclusionName | ||
* A fully-qualified path representing a folder_exclusion resources. | ||
* @returns {String} - A string representing the folder. | ||
*/ | ||
matchFolderFromFolderExclusionName(folderExclusionName) { | ||
return this._pathTemplates.folderExclusionPathTemplate.match( | ||
folderExclusionName | ||
).folder; | ||
} | ||
/** | ||
* Parse the folderExclusionName from a folder_exclusion resource. | ||
* | ||
* @param {String} folderExclusionName | ||
* A fully-qualified path representing a folder_exclusion resources. | ||
* @returns {String} - A string representing the exclusion. | ||
*/ | ||
matchExclusionFromFolderExclusionName(folderExclusionName) { | ||
return this._pathTemplates.folderExclusionPathTemplate.match( | ||
folderExclusionName | ||
).exclusion; | ||
} | ||
/** | ||
* Parse the folderSinkName from a folder_sink resource. | ||
* | ||
* @param {String} folderSinkName | ||
* A fully-qualified path representing a folder_sink resources. | ||
* @returns {String} - A string representing the folder. | ||
*/ | ||
matchFolderFromFolderSinkName(folderSinkName) { | ||
return this._pathTemplates.folderSinkPathTemplate.match(folderSinkName) | ||
.folder; | ||
} | ||
/** | ||
* Parse the folderSinkName from a folder_sink resource. | ||
* | ||
* @param {String} folderSinkName | ||
* A fully-qualified path representing a folder_sink resources. | ||
* @returns {String} - A string representing the sink. | ||
*/ | ||
matchSinkFromFolderSinkName(folderSinkName) { | ||
return this._pathTemplates.folderSinkPathTemplate.match(folderSinkName) | ||
.sink; | ||
} | ||
/** | ||
* Parse the organizationName from a organization resource. | ||
* | ||
* @param {String} organizationName | ||
* A fully-qualified path representing a organization resources. | ||
* @returns {String} - A string representing the organization. | ||
*/ | ||
matchOrganizationFromOrganizationName(organizationName) { | ||
return this._pathTemplates.organizationPathTemplate.match(organizationName) | ||
.organization; | ||
} | ||
/** | ||
* Parse the organizationExclusionName from a organization_exclusion resource. | ||
* | ||
* @param {String} organizationExclusionName | ||
* A fully-qualified path representing a organization_exclusion resources. | ||
* @returns {String} - A string representing the organization. | ||
*/ | ||
matchOrganizationFromOrganizationExclusionName(organizationExclusionName) { | ||
return this._pathTemplates.organizationExclusionPathTemplate.match( | ||
organizationExclusionName | ||
).organization; | ||
} | ||
/** | ||
* Parse the organizationExclusionName from a organization_exclusion resource. | ||
* | ||
* @param {String} organizationExclusionName | ||
* A fully-qualified path representing a organization_exclusion resources. | ||
* @returns {String} - A string representing the exclusion. | ||
*/ | ||
matchExclusionFromOrganizationExclusionName(organizationExclusionName) { | ||
return this._pathTemplates.organizationExclusionPathTemplate.match( | ||
organizationExclusionName | ||
).exclusion; | ||
} | ||
/** | ||
* Parse the organizationSinkName from a organization_sink resource. | ||
* | ||
* @param {String} organizationSinkName | ||
* A fully-qualified path representing a organization_sink resources. | ||
* @returns {String} - A string representing the organization. | ||
*/ | ||
matchOrganizationFromOrganizationSinkName(organizationSinkName) { | ||
return this._pathTemplates.organizationSinkPathTemplate.match( | ||
organizationSinkName | ||
).organization; | ||
} | ||
/** | ||
* Parse the organizationSinkName from a organization_sink resource. | ||
* | ||
* @param {String} organizationSinkName | ||
* A fully-qualified path representing a organization_sink resources. | ||
* @returns {String} - A string representing the sink. | ||
*/ | ||
matchSinkFromOrganizationSinkName(organizationSinkName) { | ||
return this._pathTemplates.organizationSinkPathTemplate.match( | ||
organizationSinkName | ||
).sink; | ||
} | ||
/** | ||
* Parse the projectName from a project resource. | ||
@@ -1203,0 +1535,0 @@ * |
@@ -104,3 +104,19 @@ // Copyright 2019 Google LLC | ||
this._pathTemplates = { | ||
billingPathTemplate: new gax.PathTemplate( | ||
'billingAccounts/{billing_account}' | ||
), | ||
billingLogPathTemplate: new gax.PathTemplate( | ||
'billingAccounts/{billing_account}/logs/{log}' | ||
), | ||
folderPathTemplate: new gax.PathTemplate('folders/{folder}'), | ||
folderLogPathTemplate: new gax.PathTemplate( | ||
'folders/{folder}/logs/{log}' | ||
), | ||
logPathTemplate: new gax.PathTemplate('projects/{project}/logs/{log}'), | ||
organizationPathTemplate: new gax.PathTemplate( | ||
'organizations/{organization}' | ||
), | ||
organizationLogPathTemplate: new gax.PathTemplate( | ||
'organizations/{organization}/logs/{log}' | ||
), | ||
projectPathTemplate: new gax.PathTemplate('projects/{project}'), | ||
@@ -957,2 +973,54 @@ }; | ||
/** | ||
* Return a fully-qualified billing resource name string. | ||
* | ||
* @param {String} billingAccount | ||
* @returns {String} | ||
*/ | ||
billingPath(billingAccount) { | ||
return this._pathTemplates.billingPathTemplate.render({ | ||
billing_account: billingAccount, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified billing_log resource name string. | ||
* | ||
* @param {String} billingAccount | ||
* @param {String} log | ||
* @returns {String} | ||
*/ | ||
billingLogPath(billingAccount, log) { | ||
return this._pathTemplates.billingLogPathTemplate.render({ | ||
billing_account: billingAccount, | ||
log: log, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified folder resource name string. | ||
* | ||
* @param {String} folder | ||
* @returns {String} | ||
*/ | ||
folderPath(folder) { | ||
return this._pathTemplates.folderPathTemplate.render({ | ||
folder: folder, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified folder_log resource name string. | ||
* | ||
* @param {String} folder | ||
* @param {String} log | ||
* @returns {String} | ||
*/ | ||
folderLogPath(folder, log) { | ||
return this._pathTemplates.folderLogPathTemplate.render({ | ||
folder: folder, | ||
log: log, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified log resource name string. | ||
@@ -972,2 +1040,28 @@ * | ||
/** | ||
* Return a fully-qualified organization resource name string. | ||
* | ||
* @param {String} organization | ||
* @returns {String} | ||
*/ | ||
organizationPath(organization) { | ||
return this._pathTemplates.organizationPathTemplate.render({ | ||
organization: organization, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified organization_log resource name string. | ||
* | ||
* @param {String} organization | ||
* @param {String} log | ||
* @returns {String} | ||
*/ | ||
organizationLogPath(organization, log) { | ||
return this._pathTemplates.organizationLogPathTemplate.render({ | ||
organization: organization, | ||
log: log, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified project resource name string. | ||
@@ -985,2 +1079,71 @@ * | ||
/** | ||
* Parse the billingName from a billing resource. | ||
* | ||
* @param {String} billingName | ||
* A fully-qualified path representing a billing resources. | ||
* @returns {String} - A string representing the billing_account. | ||
*/ | ||
matchBillingAccountFromBillingName(billingName) { | ||
return this._pathTemplates.billingPathTemplate.match(billingName) | ||
.billing_account; | ||
} | ||
/** | ||
* Parse the billingLogName from a billing_log resource. | ||
* | ||
* @param {String} billingLogName | ||
* A fully-qualified path representing a billing_log resources. | ||
* @returns {String} - A string representing the billing_account. | ||
*/ | ||
matchBillingAccountFromBillingLogName(billingLogName) { | ||
return this._pathTemplates.billingLogPathTemplate.match(billingLogName) | ||
.billing_account; | ||
} | ||
/** | ||
* Parse the billingLogName from a billing_log resource. | ||
* | ||
* @param {String} billingLogName | ||
* A fully-qualified path representing a billing_log resources. | ||
* @returns {String} - A string representing the log. | ||
*/ | ||
matchLogFromBillingLogName(billingLogName) { | ||
return this._pathTemplates.billingLogPathTemplate.match(billingLogName).log; | ||
} | ||
/** | ||
* Parse the folderName from a folder resource. | ||
* | ||
* @param {String} folderName | ||
* A fully-qualified path representing a folder resources. | ||
* @returns {String} - A string representing the folder. | ||
*/ | ||
matchFolderFromFolderName(folderName) { | ||
return this._pathTemplates.folderPathTemplate.match(folderName).folder; | ||
} | ||
/** | ||
* Parse the folderLogName from a folder_log resource. | ||
* | ||
* @param {String} folderLogName | ||
* A fully-qualified path representing a folder_log resources. | ||
* @returns {String} - A string representing the folder. | ||
*/ | ||
matchFolderFromFolderLogName(folderLogName) { | ||
return this._pathTemplates.folderLogPathTemplate.match(folderLogName) | ||
.folder; | ||
} | ||
/** | ||
* Parse the folderLogName from a folder_log resource. | ||
* | ||
* @param {String} folderLogName | ||
* A fully-qualified path representing a folder_log resources. | ||
* @returns {String} - A string representing the log. | ||
*/ | ||
matchLogFromFolderLogName(folderLogName) { | ||
return this._pathTemplates.folderLogPathTemplate.match(folderLogName).log; | ||
} | ||
/** | ||
* Parse the logName from a log resource. | ||
@@ -1008,2 +1171,40 @@ * | ||
/** | ||
* Parse the organizationName from a organization resource. | ||
* | ||
* @param {String} organizationName | ||
* A fully-qualified path representing a organization resources. | ||
* @returns {String} - A string representing the organization. | ||
*/ | ||
matchOrganizationFromOrganizationName(organizationName) { | ||
return this._pathTemplates.organizationPathTemplate.match(organizationName) | ||
.organization; | ||
} | ||
/** | ||
* Parse the organizationLogName from a organization_log resource. | ||
* | ||
* @param {String} organizationLogName | ||
* A fully-qualified path representing a organization_log resources. | ||
* @returns {String} - A string representing the organization. | ||
*/ | ||
matchOrganizationFromOrganizationLogName(organizationLogName) { | ||
return this._pathTemplates.organizationLogPathTemplate.match( | ||
organizationLogName | ||
).organization; | ||
} | ||
/** | ||
* Parse the organizationLogName from a organization_log resource. | ||
* | ||
* @param {String} organizationLogName | ||
* A fully-qualified path representing a organization_log resources. | ||
* @returns {String} - A string representing the log. | ||
*/ | ||
matchLogFromOrganizationLogName(organizationLogName) { | ||
return this._pathTemplates.organizationLogPathTemplate.match( | ||
organizationLogName | ||
).log; | ||
} | ||
/** | ||
* Parse the projectName from a project resource. | ||
@@ -1010,0 +1211,0 @@ * |
@@ -103,5 +103,12 @@ // Copyright 2019 Google LLC | ||
this._pathTemplates = { | ||
billingPathTemplate: new gax.PathTemplate( | ||
'billingAccounts/{billing_account}' | ||
), | ||
folderPathTemplate: new gax.PathTemplate('folders/{folder}'), | ||
metricPathTemplate: new gax.PathTemplate( | ||
'projects/{project}/metrics/{metric}' | ||
), | ||
organizationPathTemplate: new gax.PathTemplate( | ||
'organizations/{organization}' | ||
), | ||
projectPathTemplate: new gax.PathTemplate('projects/{project}'), | ||
@@ -620,2 +627,26 @@ }; | ||
/** | ||
* Return a fully-qualified billing resource name string. | ||
* | ||
* @param {String} billingAccount | ||
* @returns {String} | ||
*/ | ||
billingPath(billingAccount) { | ||
return this._pathTemplates.billingPathTemplate.render({ | ||
billing_account: billingAccount, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified folder resource name string. | ||
* | ||
* @param {String} folder | ||
* @returns {String} | ||
*/ | ||
folderPath(folder) { | ||
return this._pathTemplates.folderPathTemplate.render({ | ||
folder: folder, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified metric resource name string. | ||
@@ -635,2 +666,14 @@ * | ||
/** | ||
* Return a fully-qualified organization resource name string. | ||
* | ||
* @param {String} organization | ||
* @returns {String} | ||
*/ | ||
organizationPath(organization) { | ||
return this._pathTemplates.organizationPathTemplate.render({ | ||
organization: organization, | ||
}); | ||
} | ||
/** | ||
* Return a fully-qualified project resource name string. | ||
@@ -648,2 +691,25 @@ * | ||
/** | ||
* Parse the billingName from a billing resource. | ||
* | ||
* @param {String} billingName | ||
* A fully-qualified path representing a billing resources. | ||
* @returns {String} - A string representing the billing_account. | ||
*/ | ||
matchBillingAccountFromBillingName(billingName) { | ||
return this._pathTemplates.billingPathTemplate.match(billingName) | ||
.billing_account; | ||
} | ||
/** | ||
* Parse the folderName from a folder resource. | ||
* | ||
* @param {String} folderName | ||
* A fully-qualified path representing a folder resources. | ||
* @returns {String} - A string representing the folder. | ||
*/ | ||
matchFolderFromFolderName(folderName) { | ||
return this._pathTemplates.folderPathTemplate.match(folderName).folder; | ||
} | ||
/** | ||
* Parse the metricName from a metric resource. | ||
@@ -671,2 +737,14 @@ * | ||
/** | ||
* Parse the organizationName from a organization resource. | ||
* | ||
* @param {String} organizationName | ||
* A fully-qualified path representing a organization resources. | ||
* @returns {String} - A string representing the organization. | ||
*/ | ||
matchOrganizationFromOrganizationName(organizationName) { | ||
return this._pathTemplates.organizationPathTemplate.match(organizationName) | ||
.organization; | ||
} | ||
/** | ||
* Parse the projectName from a project resource. | ||
@@ -673,0 +751,0 @@ * |
@@ -7,2 +7,9 @@ # Changelog | ||
## [5.2.0](https://www.github.com/googleapis/nodejs-logging/compare/v5.1.3...v5.2.0) (2019-07-17) | ||
### Features | ||
* add path template parsing for billing, organizations, and folders ([#529](https://www.github.com/googleapis/nodejs-logging/issues/529)) ([1e8c67f](https://www.github.com/googleapis/nodejs-logging/commit/1e8c67f)) | ||
### [5.1.3](https://www.github.com/googleapis/nodejs-logging/compare/v5.1.2...v5.1.3) (2019-06-26) | ||
@@ -9,0 +16,0 @@ |
{ | ||
"name": "@google-cloud/logging", | ||
"description": "Stackdriver Logging Client Library for Node.js", | ||
"version": "5.1.3", | ||
"version": "5.2.0", | ||
"license": "Apache-2.0", | ||
@@ -51,3 +51,3 @@ "author": "Google Inc.", | ||
"proto:logging_config": "pbjs -t static-module -w commonjs -p node_modules/google-proto-files google/logging/v2/logging_config.proto | pbts -o proto/logging_config.d.ts -", | ||
"docs-test": "linkinator docs -r --skip www.googleapis.com", | ||
"docs-test": "linkinator docs", | ||
"predocs-test": "npm run docs" | ||
@@ -106,3 +106,3 @@ }, | ||
"jsdoc-baseline": "^0.1.0", | ||
"linkinator": "^1.4.2", | ||
"linkinator": "^1.5.0", | ||
"mocha": "^6.1.4", | ||
@@ -109,0 +109,0 @@ "mv": "^2.1.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1298484
25648