|
| 1 | +# pylint: disable=line-too-long |
| 2 | + |
| 3 | +from ..types import OperationInput, CaseInsensitiveDict |
| 4 | +from .. import serde |
| 5 | +from .. import serde_utils |
| 6 | +from .. import models |
| 7 | +from .._client import _SyncClientImpl |
| 8 | + |
| 9 | + |
| 10 | +def get_public_access_block(client: _SyncClientImpl, request: models.GetPublicAccessBlockRequest, **kwargs) -> models.GetPublicAccessBlockResult: |
| 11 | + """ |
| 12 | + get_public_access_block synchronously |
| 13 | +
|
| 14 | + Args: |
| 15 | + client (_SyncClientImpl): A agent that sends the request. |
| 16 | + request (GetPublicAccessBlockRequest): The request for the GetPublicAccessBlock operation. |
| 17 | +
|
| 18 | + Returns: |
| 19 | + GetPublicAccessBlockResult: The result for the GetPublicAccessBlock operation. |
| 20 | + """ |
| 21 | + |
| 22 | + op_input = serde.serialize_input( |
| 23 | + request=request, |
| 24 | + op_input=OperationInput( |
| 25 | + op_name='GetPublicAccessBlock', |
| 26 | + method='GET', |
| 27 | + headers=CaseInsensitiveDict({ |
| 28 | + 'Content-Type': 'application/xml', |
| 29 | + }), |
| 30 | + parameters={ |
| 31 | + 'publicAccessBlock': '', |
| 32 | + }, |
| 33 | + op_metadata={'sub-resource': ['publicAccessBlock']}, |
| 34 | + ), |
| 35 | + custom_serializer=[ |
| 36 | + serde_utils.add_content_md5 |
| 37 | + ] |
| 38 | + ) |
| 39 | + |
| 40 | + op_output = client.invoke_operation(op_input, **kwargs) |
| 41 | + |
| 42 | + return serde.deserialize_output( |
| 43 | + result=models.GetPublicAccessBlockResult(), |
| 44 | + op_output=op_output, |
| 45 | + custom_deserializer=[ |
| 46 | + serde.deserialize_output_xmlbody |
| 47 | + ], |
| 48 | + ) |
| 49 | + |
| 50 | +def put_public_access_block(client: _SyncClientImpl, request: models.PutPublicAccessBlockRequest, **kwargs) -> models.PutPublicAccessBlockResult: |
| 51 | + """ |
| 52 | + put_public_access_block synchronously |
| 53 | +
|
| 54 | + Args: |
| 55 | + client (_SyncClientImpl): A agent that sends the request. |
| 56 | + request (PutPublicAccessBlockRequest): The request for the PutPublicAccessBlock operation. |
| 57 | +
|
| 58 | + Returns: |
| 59 | + PutPublicAccessBlockResult: The result for the PutPublicAccessBlock operation. |
| 60 | + """ |
| 61 | + |
| 62 | + op_input = serde.serialize_input( |
| 63 | + request=request, |
| 64 | + op_input=OperationInput( |
| 65 | + op_name='PutPublicAccessBlock', |
| 66 | + method='PUT', |
| 67 | + headers=CaseInsensitiveDict({ |
| 68 | + 'Content-Type': 'application/xml', |
| 69 | + }), |
| 70 | + parameters={ |
| 71 | + 'publicAccessBlock': '', |
| 72 | + }, |
| 73 | + op_metadata={'sub-resource': ['publicAccessBlock']}, |
| 74 | + ), |
| 75 | + custom_serializer=[ |
| 76 | + serde_utils.add_content_md5 |
| 77 | + ] |
| 78 | + ) |
| 79 | + |
| 80 | + op_output = client.invoke_operation(op_input, **kwargs) |
| 81 | + |
| 82 | + return serde.deserialize_output( |
| 83 | + result=models.PutPublicAccessBlockResult(), |
| 84 | + op_output=op_output, |
| 85 | + custom_deserializer=[ |
| 86 | + serde.deserialize_output_xmlbody |
| 87 | + ], |
| 88 | + ) |
| 89 | + |
| 90 | +def delete_public_access_block(client: _SyncClientImpl, request: models.DeletePublicAccessBlockRequest, **kwargs) -> models.DeletePublicAccessBlockResult: |
| 91 | + """ |
| 92 | + delete_public_access_block synchronously |
| 93 | +
|
| 94 | + Args: |
| 95 | + client (_SyncClientImpl): A agent that sends the request. |
| 96 | + request (DeletePublicAccessBlockRequest): The request for the DeletePublicAccessBlock operation. |
| 97 | +
|
| 98 | + Returns: |
| 99 | + DeletePublicAccessBlockResult: The result for the DeletePublicAccessBlock operation. |
| 100 | + """ |
| 101 | + |
| 102 | + op_input = serde.serialize_input( |
| 103 | + request=request, |
| 104 | + op_input=OperationInput( |
| 105 | + op_name='DeletePublicAccessBlock', |
| 106 | + method='DELETE', |
| 107 | + headers=CaseInsensitiveDict({ |
| 108 | + 'Content-Type': 'application/xml', |
| 109 | + }), |
| 110 | + parameters={ |
| 111 | + 'publicAccessBlock': '', |
| 112 | + }, |
| 113 | + op_metadata={'sub-resource': ['publicAccessBlock']}, |
| 114 | + ), |
| 115 | + custom_serializer=[ |
| 116 | + serde_utils.add_content_md5 |
| 117 | + ] |
| 118 | + ) |
| 119 | + |
| 120 | + op_output = client.invoke_operation(op_input, **kwargs) |
| 121 | + |
| 122 | + return serde.deserialize_output( |
| 123 | + result=models.DeletePublicAccessBlockResult(), |
| 124 | + op_output=op_output, |
| 125 | + custom_deserializer=[ |
| 126 | + serde.deserialize_output_xmlbody |
| 127 | + ], |
| 128 | + ) |
0 commit comments