4343from otcextensions .sdk .apig .v2 import metric_data as _metric_data
4444from otcextensions .sdk .apig .v2 import group_response as _group_response
4545from otcextensions .sdk .apig .v2 import error_response as _error_response
46+ from otcextensions .sdk .apig .v2 import tag as _tag
4647
4748
4849class Proxy (proxy .Proxy ):
@@ -3105,6 +3106,23 @@ def delete_group_response(self, gateway, group, response,
31053106 )
31063107
31073108 def get_error_response (self , gateway , group , response , response_type ):
3109+ """
3110+ Retrieve a specific error response for an API group
3111+ This method fetches details of a specific error response for an API
3112+ group within the specified API Gateway instance.
3113+
3114+ :param gateway: The ID of the API Gateway instance or an instance of
3115+ :class:`~otcextensions.sdk.apig.v2.gateway.Gateway`
3116+ :param group: The ID of the API group or an instance of
3117+ :class:`~otcextensions.sdk.apig.v2.group.Group`
3118+ :param response: The ID of the group response or an instance of
3119+ :class:`~otcextensions.sdk.apig.v2.group_response.GroupResponse`
3120+ :param response_type: The type of the error response (e.g., 'default',
3121+ 'unauthorized', 'not_found', etc.)
3122+
3123+ :returns: An instance of
3124+ :class:`~otcextensions.sdk.apig.v2.error_response.ErrorResponse`
3125+ """
31083126 gateway = self ._get_resource (_gateway .Gateway , gateway )
31093127 group = self ._get_resource (_api_group .ApiGroup , group )
31103128 response = self ._get_resource (_group_response .GroupResponse , response )
@@ -3119,6 +3137,23 @@ def get_error_response(self, gateway, group, response, response_type):
31193137
31203138 def update_error_response (self , gateway , group , response , response_type ,
31213139 ** attrs ):
3140+ """Update a custom error response for an API group
3141+ This method updates an existing custom error response for a specific
3142+ API group within the specified API Gateway instance.
3143+
3144+ :param gateway: The ID of the API Gateway instance or an instance of
3145+ :class:`~otcextensions.sdk.apig.v2.gateway.Gateway`
3146+ :param group: The ID of the API group or an instance of
3147+ :class:`~otcextensions.sdk.apig.v2.group.Group`
3148+ :param response: The ID of the group response or an instance of
3149+ :class:`~otcextensions.sdk.apig.v2.group_response.GroupResponse`
3150+ :param response_type: The type of the error response (e.g., 'default',
3151+ 'unauthorized', 'not_found', etc.)
3152+ :param attrs: Attributes to update in the error response
3153+
3154+ :returns: The updated instance of
3155+ :class:`~otcextensions.sdk.apig.v2.error_response.ErrorResponse`
3156+ """
31223157 gateway = self ._get_resource (_gateway .Gateway , gateway )
31233158 response = self ._get_resource (_group_response .GroupResponse , response )
31243159 group = self ._get_resource (_api_group .ApiGroup , group )
@@ -3133,6 +3168,22 @@ def update_error_response(self, gateway, group, response, response_type,
31333168 )
31343169
31353170 def delete_error_response (self , gateway , group , response , response_type ):
3171+ """
3172+ Delete a custom error response for an API group
3173+ This method deletes a specific custom error response for an API group
3174+ within the specified API Gateway instance.
3175+
3176+ :param gateway: The ID of the API Gateway instance or an instance of
3177+ :class:`~otcextensions.sdk.apig.v2.gateway.Gateway`
3178+ :param group: The ID of the API group or an instance of
3179+ :class:`~otcextensions.sdk.apig.v2.group.Group`
3180+ :param response: The ID of the group response or an instance of
3181+ :class:`~otcextensions.sdk.apig.v2.group_response.GroupResponse`
3182+ :param response_type: The type of the error response (e.g., 'default',
3183+ 'unauthorized', 'not_found', etc.)
3184+
3185+ :returns: None
3186+ """
31363187 gateway = self ._get_resource (_gateway .Gateway , gateway )
31373188 group = self ._get_resource (_api_group .ApiGroup , group )
31383189 response = self ._get_resource (_group_response .GroupResponse , response )
@@ -3144,3 +3195,22 @@ def delete_error_response(self, gateway, group, response, response_type):
31443195 response_id = response .id ,
31453196 response_type = response_type ,
31463197 )
3198+
3199+ # ======== Tag Management Methods ========
3200+ def tags (self , gateway ):
3201+ """List all tags for an API Gateway instance
3202+
3203+ This method retrieves all tags associated with the specified API
3204+ Gateway instance.
3205+
3206+ :param gateway: The ID of the API Gateway instance or an instance of
3207+ :class:`~otcextensions.sdk.apig.v2.gateway.Gateway`
3208+
3209+ :returns: A generator of
3210+ :class:`~otcextensions.sdk.apig.v2.tag.Tag` instances
3211+ """
3212+ gateway = self ._get_resource (_gateway .Gateway , gateway )
3213+ return self ._list (
3214+ _tag .Tag ,
3215+ gateway_id = gateway .id
3216+ )
0 commit comments