Skip to content

Commit 6223b7f

Browse files
feat(apim): update the API
#### apim:v1alpha The following keys were added: - resources.projects.resources.locations.methods.getEntitlement.description - resources.projects.resources.locations.methods.getEntitlement.flatPath - resources.projects.resources.locations.methods.getEntitlement.httpMethod - resources.projects.resources.locations.methods.getEntitlement.id - resources.projects.resources.locations.methods.getEntitlement.parameterOrder - resources.projects.resources.locations.methods.getEntitlement.parameters.name.description - resources.projects.resources.locations.methods.getEntitlement.parameters.name.location - resources.projects.resources.locations.methods.getEntitlement.parameters.name.pattern - resources.projects.resources.locations.methods.getEntitlement.parameters.name.required - resources.projects.resources.locations.methods.getEntitlement.parameters.name.type - resources.projects.resources.locations.methods.getEntitlement.path - resources.projects.resources.locations.methods.getEntitlement.response.$ref - resources.projects.resources.locations.methods.getEntitlement.scopes - schemas.Entitlement.description - schemas.Entitlement.id - schemas.Entitlement.properties.apiObservationEntitled.description - schemas.Entitlement.properties.apiObservationEntitled.type - schemas.Entitlement.properties.billingProjectNumber.description - schemas.Entitlement.properties.billingProjectNumber.format - schemas.Entitlement.properties.billingProjectNumber.type - schemas.Entitlement.properties.createTime.description - schemas.Entitlement.properties.createTime.format - schemas.Entitlement.properties.createTime.readOnly - schemas.Entitlement.properties.createTime.type - schemas.Entitlement.properties.name.description - schemas.Entitlement.properties.name.type - schemas.Entitlement.properties.updateTime.description - schemas.Entitlement.properties.updateTime.format - schemas.Entitlement.properties.updateTime.readOnly - schemas.Entitlement.properties.updateTime.type - schemas.Entitlement.type
1 parent 4cb60ae commit 6223b7f

File tree

2 files changed

+228
-1
lines changed

2 files changed

+228
-1
lines changed

discovery/apim-v1alpha.json

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,31 @@
134134
"https://www.googleapis.com/auth/cloud-platform"
135135
]
136136
},
137+
"getEntitlement": {
138+
"description": "GetEntitlement returns the entitlement for the provided project.",
139+
"flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/entitlement",
140+
"httpMethod": "GET",
141+
"id": "apim.projects.locations.getEntitlement",
142+
"parameterOrder": [
143+
"name"
144+
],
145+
"parameters": {
146+
"name": {
147+
"description": "Required. The entitlement resource name Format: projects/{project}/locations/{location}/entitlement",
148+
"location": "path",
149+
"pattern": "^projects/[^/]+/locations/[^/]+/entitlement$",
150+
"required": true,
151+
"type": "string"
152+
}
153+
},
154+
"path": "v1alpha/{+name}",
155+
"response": {
156+
"$ref": "Entitlement"
157+
},
158+
"scopes": [
159+
"https://www.googleapis.com/auth/cloud-platform"
160+
]
161+
},
137162
"list": {
138163
"description": "Lists information about the supported locations for this service.",
139164
"flatPath": "v1alpha/projects/{projectsId}/locations",
@@ -821,7 +846,7 @@
821846
}
822847
}
823848
},
824-
"revision": "20250521",
849+
"revision": "20250730",
825850
"rootUrl": "https://apim.googleapis.com/",
826851
"schemas": {
827852
"ApiObservation": {
@@ -996,6 +1021,38 @@
9961021
"properties": {},
9971022
"type": "object"
9981023
},
1024+
"Entitlement": {
1025+
"description": "Entitlement stores data related to API Observation entitlement for a given project",
1026+
"id": "Entitlement",
1027+
"properties": {
1028+
"apiObservationEntitled": {
1029+
"description": "Whether API Observation is entitled.",
1030+
"type": "boolean"
1031+
},
1032+
"billingProjectNumber": {
1033+
"description": "Project number of associated billing project that has Apigee and Advanced API Security entitled.",
1034+
"format": "int64",
1035+
"type": "string"
1036+
},
1037+
"createTime": {
1038+
"description": "Output only. The time of the entitlement creation.",
1039+
"format": "google-datetime",
1040+
"readOnly": true,
1041+
"type": "string"
1042+
},
1043+
"name": {
1044+
"description": "Identifier. The entitlement resource name `projects/{project}/locations/{location}/entitlement`",
1045+
"type": "string"
1046+
},
1047+
"updateTime": {
1048+
"description": "Output only. The time of the entitlement update.",
1049+
"format": "google-datetime",
1050+
"readOnly": true,
1051+
"type": "string"
1052+
}
1053+
},
1054+
"type": "object"
1055+
},
9991056
"GclbObservationSource": {
10001057
"description": "The GCLB observation source.",
10011058
"id": "GclbObservationSource",

src/apis/apim/v1alpha.ts

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,31 @@ export namespace apim_v1alpha {
241241
* Message for enabling an ObservationJob
242242
*/
243243
export interface Schema$EnableObservationJobRequest {}
244+
/**
245+
* Entitlement stores data related to API Observation entitlement for a given project
246+
*/
247+
export interface Schema$Entitlement {
248+
/**
249+
* Whether API Observation is entitled.
250+
*/
251+
apiObservationEntitled?: boolean | null;
252+
/**
253+
* Project number of associated billing project that has Apigee and Advanced API Security entitled.
254+
*/
255+
billingProjectNumber?: string | null;
256+
/**
257+
* Output only. The time of the entitlement creation.
258+
*/
259+
createTime?: string | null;
260+
/**
261+
* Identifier. The entitlement resource name `projects/{project\}/locations/{location\}/entitlement`
262+
*/
263+
name?: string | null;
264+
/**
265+
* Output only. The time of the entitlement update.
266+
*/
267+
updateTime?: string | null;
268+
}
244269
/**
245270
* The GCLB observation source.
246271
*/
@@ -788,6 +813,144 @@ export namespace apim_v1alpha {
788813
}
789814
}
790815

816+
/**
817+
* GetEntitlement returns the entitlement for the provided project.
818+
* @example
819+
* ```js
820+
* // Before running the sample:
821+
* // - Enable the API at:
822+
* // https://console.developers.google.com/apis/api/apim.googleapis.com
823+
* // - Login into gcloud by running:
824+
* // ```sh
825+
* // $ gcloud auth application-default login
826+
* // ```
827+
* // - Install the npm module by running:
828+
* // ```sh
829+
* // $ npm install googleapis
830+
* // ```
831+
*
832+
* const {google} = require('googleapis');
833+
* const apim = google.apim('v1alpha');
834+
*
835+
* async function main() {
836+
* const auth = new google.auth.GoogleAuth({
837+
* // Scopes can be specified either as an array or as a single, space-delimited string.
838+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
839+
* });
840+
*
841+
* // Acquire an auth client, and bind it to all future calls
842+
* const authClient = await auth.getClient();
843+
* google.options({auth: authClient});
844+
*
845+
* // Do the magic
846+
* const res = await apim.projects.locations.getEntitlement({
847+
* // Required. The entitlement resource name Format: projects/{project\}/locations/{location\}/entitlement
848+
* name: 'projects/my-project/locations/my-location/entitlement',
849+
* });
850+
* console.log(res.data);
851+
*
852+
* // Example response
853+
* // {
854+
* // "apiObservationEntitled": false,
855+
* // "billingProjectNumber": "my_billingProjectNumber",
856+
* // "createTime": "my_createTime",
857+
* // "name": "my_name",
858+
* // "updateTime": "my_updateTime"
859+
* // }
860+
* }
861+
*
862+
* main().catch(e => {
863+
* console.error(e);
864+
* throw e;
865+
* });
866+
*
867+
* ```
868+
*
869+
* @param params - Parameters for request
870+
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
871+
* @param callback - Optional callback that handles the response.
872+
* @returns A promise if used with async/await, or void if used with a callback.
873+
*/
874+
getEntitlement(
875+
params: Params$Resource$Projects$Locations$Getentitlement,
876+
options: StreamMethodOptions
877+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
878+
getEntitlement(
879+
params?: Params$Resource$Projects$Locations$Getentitlement,
880+
options?: MethodOptions
881+
): Promise<GaxiosResponseWithHTTP2<Schema$Entitlement>>;
882+
getEntitlement(
883+
params: Params$Resource$Projects$Locations$Getentitlement,
884+
options: StreamMethodOptions | BodyResponseCallback<Readable>,
885+
callback: BodyResponseCallback<Readable>
886+
): void;
887+
getEntitlement(
888+
params: Params$Resource$Projects$Locations$Getentitlement,
889+
options: MethodOptions | BodyResponseCallback<Schema$Entitlement>,
890+
callback: BodyResponseCallback<Schema$Entitlement>
891+
): void;
892+
getEntitlement(
893+
params: Params$Resource$Projects$Locations$Getentitlement,
894+
callback: BodyResponseCallback<Schema$Entitlement>
895+
): void;
896+
getEntitlement(callback: BodyResponseCallback<Schema$Entitlement>): void;
897+
getEntitlement(
898+
paramsOrCallback?:
899+
| Params$Resource$Projects$Locations$Getentitlement
900+
| BodyResponseCallback<Schema$Entitlement>
901+
| BodyResponseCallback<Readable>,
902+
optionsOrCallback?:
903+
| MethodOptions
904+
| StreamMethodOptions
905+
| BodyResponseCallback<Schema$Entitlement>
906+
| BodyResponseCallback<Readable>,
907+
callback?:
908+
| BodyResponseCallback<Schema$Entitlement>
909+
| BodyResponseCallback<Readable>
910+
):
911+
| void
912+
| Promise<GaxiosResponseWithHTTP2<Schema$Entitlement>>
913+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
914+
let params = (paramsOrCallback ||
915+
{}) as Params$Resource$Projects$Locations$Getentitlement;
916+
let options = (optionsOrCallback || {}) as MethodOptions;
917+
918+
if (typeof paramsOrCallback === 'function') {
919+
callback = paramsOrCallback;
920+
params = {} as Params$Resource$Projects$Locations$Getentitlement;
921+
options = {};
922+
}
923+
924+
if (typeof optionsOrCallback === 'function') {
925+
callback = optionsOrCallback;
926+
options = {};
927+
}
928+
929+
const rootUrl = options.rootUrl || 'https://apim.googleapis.com/';
930+
const parameters = {
931+
options: Object.assign(
932+
{
933+
url: (rootUrl + '/v1alpha/{+name}').replace(/([^:]\/)\/+/g, '$1'),
934+
method: 'GET',
935+
apiVersion: '',
936+
},
937+
options
938+
),
939+
params,
940+
requiredParams: ['name'],
941+
pathParams: ['name'],
942+
context: this.context,
943+
};
944+
if (callback) {
945+
createAPIRequest<Schema$Entitlement>(
946+
parameters,
947+
callback as BodyResponseCallback<unknown>
948+
);
949+
} else {
950+
return createAPIRequest<Schema$Entitlement>(parameters);
951+
}
952+
}
953+
791954
/**
792955
* Lists information about the supported locations for this service.
793956
* @example
@@ -1092,6 +1255,13 @@ export namespace apim_v1alpha {
10921255
*/
10931256
name?: string;
10941257
}
1258+
export interface Params$Resource$Projects$Locations$Getentitlement
1259+
extends StandardParameters {
1260+
/**
1261+
* Required. The entitlement resource name Format: projects/{project\}/locations/{location\}/entitlement
1262+
*/
1263+
name?: string;
1264+
}
10951265
export interface Params$Resource$Projects$Locations$List
10961266
extends StandardParameters {
10971267
/**

0 commit comments

Comments
 (0)