@@ -241,6 +241,31 @@ export namespace apim_v1alpha {
241
241
* Message for enabling an ObservationJob
242
242
*/
243
243
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
+ }
244
269
/**
245
270
* The GCLB observation source.
246
271
*/
@@ -788,6 +813,144 @@ export namespace apim_v1alpha {
788
813
}
789
814
}
790
815
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
+
791
954
/**
792
955
* Lists information about the supported locations for this service.
793
956
* @example
@@ -1092,6 +1255,13 @@ export namespace apim_v1alpha {
1092
1255
*/
1093
1256
name ?: string ;
1094
1257
}
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
+ }
1095
1265
export interface Params$Resource$Projects$Locations$List
1096
1266
extends StandardParameters {
1097
1267
/**
0 commit comments