1# coding: utf-8 2# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. 3# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. 4 5 6from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 7from oci.decorators import init_model_state_from_kwargs 8 9 10@init_model_state_from_kwargs 11class HeaderManipulationAction(object): 12 """ 13 An object that represents an action to apply to an HTTP headers. 14 """ 15 16 #: A constant which can be used with the action property of a HeaderManipulationAction. 17 #: This constant has a value of "EXTEND_HTTP_RESPONSE_HEADER" 18 ACTION_EXTEND_HTTP_RESPONSE_HEADER = "EXTEND_HTTP_RESPONSE_HEADER" 19 20 #: A constant which can be used with the action property of a HeaderManipulationAction. 21 #: This constant has a value of "ADD_HTTP_RESPONSE_HEADER" 22 ACTION_ADD_HTTP_RESPONSE_HEADER = "ADD_HTTP_RESPONSE_HEADER" 23 24 #: A constant which can be used with the action property of a HeaderManipulationAction. 25 #: This constant has a value of "REMOVE_HTTP_RESPONSE_HEADER" 26 ACTION_REMOVE_HTTP_RESPONSE_HEADER = "REMOVE_HTTP_RESPONSE_HEADER" 27 28 def __init__(self, **kwargs): 29 """ 30 Initializes a new HeaderManipulationAction object with values from keyword arguments. This class has the following subclasses and if you are using this class as input 31 to a service operations then you should favor using a subclass over the base class: 32 33 * :class:`~oci.waas.models.ExtendHttpResponseHeaderAction` 34 * :class:`~oci.waas.models.AddHttpResponseHeaderAction` 35 * :class:`~oci.waas.models.RemoveHttpResponseHeaderAction` 36 37 The following keyword arguments are supported (corresponding to the getters/setters of this class): 38 39 :param action: 40 The value to assign to the action property of this HeaderManipulationAction. 41 Allowed values for this property are: "EXTEND_HTTP_RESPONSE_HEADER", "ADD_HTTP_RESPONSE_HEADER", "REMOVE_HTTP_RESPONSE_HEADER", 'UNKNOWN_ENUM_VALUE'. 42 Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. 43 :type action: str 44 45 """ 46 self.swagger_types = { 47 'action': 'str' 48 } 49 50 self.attribute_map = { 51 'action': 'action' 52 } 53 54 self._action = None 55 56 @staticmethod 57 def get_subtype(object_dictionary): 58 """ 59 Given the hash representation of a subtype of this class, 60 use the info in the hash to return the class of the subtype. 61 """ 62 type = object_dictionary['action'] 63 64 if type == 'EXTEND_HTTP_RESPONSE_HEADER': 65 return 'ExtendHttpResponseHeaderAction' 66 67 if type == 'ADD_HTTP_RESPONSE_HEADER': 68 return 'AddHttpResponseHeaderAction' 69 70 if type == 'REMOVE_HTTP_RESPONSE_HEADER': 71 return 'RemoveHttpResponseHeaderAction' 72 else: 73 return 'HeaderManipulationAction' 74 75 @property 76 def action(self): 77 """ 78 **[Required]** Gets the action of this HeaderManipulationAction. 79 Allowed values for this property are: "EXTEND_HTTP_RESPONSE_HEADER", "ADD_HTTP_RESPONSE_HEADER", "REMOVE_HTTP_RESPONSE_HEADER", 'UNKNOWN_ENUM_VALUE'. 80 Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. 81 82 83 :return: The action of this HeaderManipulationAction. 84 :rtype: str 85 """ 86 return self._action 87 88 @action.setter 89 def action(self, action): 90 """ 91 Sets the action of this HeaderManipulationAction. 92 93 :param action: The action of this HeaderManipulationAction. 94 :type: str 95 """ 96 allowed_values = ["EXTEND_HTTP_RESPONSE_HEADER", "ADD_HTTP_RESPONSE_HEADER", "REMOVE_HTTP_RESPONSE_HEADER"] 97 if not value_allowed_none_or_none_sentinel(action, allowed_values): 98 action = 'UNKNOWN_ENUM_VALUE' 99 self._action = action 100 101 def __repr__(self): 102 return formatted_flat_dict(self) 103 104 def __eq__(self, other): 105 if other is None: 106 return False 107 108 return self.__dict__ == other.__dict__ 109 110 def __ne__(self, other): 111 return not self == other 112