@@ -18,6 +18,7 @@ import {
1818 marshalCreateEmailRequest ,
1919 marshalCreateWebhookRequest ,
2020 marshalUpdateDomainRequest ,
21+ marshalUpdateOfferSubscriptionRequest ,
2122 marshalUpdateProjectSettingsRequest ,
2223 marshalUpdateWebhookRequest ,
2324 unmarshalBulkCreateBlocklistsResponse ,
@@ -28,8 +29,13 @@ import {
2829 unmarshalListBlocklistsResponse ,
2930 unmarshalListDomainsResponse ,
3031 unmarshalListEmailsResponse ,
32+ unmarshalListOfferSubscriptionsResponse ,
33+ unmarshalListOffersResponse ,
34+ unmarshalListPoolsResponse ,
3135 unmarshalListWebhookEventsResponse ,
3236 unmarshalListWebhooksResponse ,
37+ unmarshalOfferSubscription ,
38+ unmarshalProjectConsumption ,
3339 unmarshalProjectSettings ,
3440 unmarshalStatistics ,
3541 unmarshalWebhook ,
@@ -51,6 +57,7 @@ import type {
5157 GetDomainLastStatusRequest ,
5258 GetDomainRequest ,
5359 GetEmailRequest ,
60+ GetProjectConsumptionRequest ,
5461 GetProjectSettingsRequest ,
5562 GetStatisticsRequest ,
5663 GetWebhookRequest ,
@@ -60,14 +67,23 @@ import type {
6067 ListDomainsResponse ,
6168 ListEmailsRequest ,
6269 ListEmailsResponse ,
70+ ListOfferSubscriptionsRequest ,
71+ ListOfferSubscriptionsResponse ,
72+ ListOffersRequest ,
73+ ListOffersResponse ,
74+ ListPoolsRequest ,
75+ ListPoolsResponse ,
6376 ListWebhookEventsRequest ,
6477 ListWebhookEventsResponse ,
6578 ListWebhooksRequest ,
6679 ListWebhooksResponse ,
80+ OfferSubscription ,
81+ ProjectConsumption ,
6782 ProjectSettings ,
6883 RevokeDomainRequest ,
6984 Statistics ,
7085 UpdateDomainRequest ,
86+ UpdateOfferSubscriptionRequest ,
7187 UpdateProjectSettingsRequest ,
7288 UpdateWebhookRequest ,
7389 Webhook ,
@@ -624,4 +640,115 @@ export class API extends ParentAPI {
624640 method : 'DELETE' ,
625641 path : `/transactional-email/v1alpha1/regions/${ validatePathParam ( 'region' , request . region ?? this . client . settings . defaultRegion ) } /blocklists/${ validatePathParam ( 'blocklistId' , request . blocklistId ) } ` ,
626642 } )
643+
644+ /**
645+ * Get information about subscribed offers. Retrieve information about the
646+ * offers you are subscribed to using the `project_id` and `region`
647+ * parameters.
648+ *
649+ * @param request - The request {@link ListOfferSubscriptionsRequest}
650+ * @returns A Promise of ListOfferSubscriptionsResponse
651+ */
652+ listOfferSubscriptions = (
653+ request : Readonly < ListOfferSubscriptionsRequest > = { } ,
654+ ) =>
655+ this . client . fetch < ListOfferSubscriptionsResponse > (
656+ {
657+ method : 'GET' ,
658+ path : `/transactional-email/v1alpha1/regions/${ validatePathParam ( 'region' , request . region ?? this . client . settings . defaultRegion ) } /offer-subscriptions` ,
659+ urlParams : urlParams ( [
660+ 'project_id' ,
661+ request . projectId ?? this . client . settings . defaultProjectId ,
662+ ] ) ,
663+ } ,
664+ unmarshalListOfferSubscriptionsResponse ,
665+ )
666+
667+ /**
668+ * Update a subscribed offer.
669+ *
670+ * @param request - The request {@link UpdateOfferSubscriptionRequest}
671+ * @returns A Promise of OfferSubscription
672+ */
673+ updateOfferSubscription = (
674+ request : Readonly < UpdateOfferSubscriptionRequest > = { } ,
675+ ) =>
676+ this . client . fetch < OfferSubscription > (
677+ {
678+ body : JSON . stringify (
679+ marshalUpdateOfferSubscriptionRequest ( request , this . client . settings ) ,
680+ ) ,
681+ headers : jsonContentHeaders ,
682+ method : 'PATCH' ,
683+ path : `/transactional-email/v1alpha1/regions/${ validatePathParam ( 'region' , request . region ?? this . client . settings . defaultRegion ) } /offer-subscriptions` ,
684+ } ,
685+ unmarshalOfferSubscription ,
686+ )
687+
688+ /**
689+ * List the available offers.. Retrieve the list of the available and
690+ * free-of-charge offers you can subscribe to.
691+ *
692+ * @param request - The request {@link ListOffersRequest}
693+ * @returns A Promise of ListOffersResponse
694+ */
695+ listOffers = ( request : Readonly < ListOffersRequest > = { } ) =>
696+ this . client . fetch < ListOffersResponse > (
697+ {
698+ method : 'GET' ,
699+ path : `/transactional-email/v1alpha1/regions/${ validatePathParam ( 'region' , request . region ?? this . client . settings . defaultRegion ) } /offers` ,
700+ } ,
701+ unmarshalListOffersResponse ,
702+ )
703+
704+ protected pageOfListPools = ( request : Readonly < ListPoolsRequest > = { } ) =>
705+ this . client . fetch < ListPoolsResponse > (
706+ {
707+ method : 'GET' ,
708+ path : `/transactional-email/v1alpha1/regions/${ validatePathParam ( 'region' , request . region ?? this . client . settings . defaultRegion ) } /pools` ,
709+ urlParams : urlParams (
710+ [ 'page' , request . page ] ,
711+ [
712+ 'page_size' ,
713+ request . pageSize ?? this . client . settings . defaultPageSize ,
714+ ] ,
715+ [
716+ 'project_id' ,
717+ request . projectId ?? this . client . settings . defaultProjectId ,
718+ ] ,
719+ ) ,
720+ } ,
721+ unmarshalListPoolsResponse ,
722+ )
723+
724+ /**
725+ * Get information about a sending pool.. Retrieve information about a sending
726+ * pool, including its creation status and configuration parameters.
727+ *
728+ * @param request - The request {@link ListPoolsRequest}
729+ * @returns A Promise of ListPoolsResponse
730+ */
731+ listPools = ( request : Readonly < ListPoolsRequest > = { } ) =>
732+ enrichForPagination ( 'pools' , this . pageOfListPools , request )
733+
734+ /**
735+ * Get project resource consumption.. Get project resource consumption.
736+ *
737+ * @param request - The request {@link GetProjectConsumptionRequest}
738+ * @returns A Promise of ProjectConsumption
739+ */
740+ getProjectConsumption = (
741+ request : Readonly < GetProjectConsumptionRequest > = { } ,
742+ ) =>
743+ this . client . fetch < ProjectConsumption > (
744+ {
745+ method : 'GET' ,
746+ path : `/transactional-email/v1alpha1/regions/${ validatePathParam ( 'region' , request . region ?? this . client . settings . defaultRegion ) } /project-consumption` ,
747+ urlParams : urlParams ( [
748+ 'project_id' ,
749+ request . projectId ?? this . client . settings . defaultProjectId ,
750+ ] ) ,
751+ } ,
752+ unmarshalProjectConsumption ,
753+ )
627754}
0 commit comments