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 Origin(object): 12 """ 13 A detailed description of your web application's origin host server. An origin must be defined to set up WAF rules. 14 """ 15 16 def __init__(self, **kwargs): 17 """ 18 Initializes a new Origin object with values from keyword arguments. 19 The following keyword arguments are supported (corresponding to the getters/setters of this class): 20 21 :param uri: 22 The value to assign to the uri property of this Origin. 23 :type uri: str 24 25 :param http_port: 26 The value to assign to the http_port property of this Origin. 27 :type http_port: int 28 29 :param https_port: 30 The value to assign to the https_port property of this Origin. 31 :type https_port: int 32 33 :param custom_headers: 34 The value to assign to the custom_headers property of this Origin. 35 :type custom_headers: list[oci.waas.models.Header] 36 37 """ 38 self.swagger_types = { 39 'uri': 'str', 40 'http_port': 'int', 41 'https_port': 'int', 42 'custom_headers': 'list[Header]' 43 } 44 45 self.attribute_map = { 46 'uri': 'uri', 47 'http_port': 'httpPort', 48 'https_port': 'httpsPort', 49 'custom_headers': 'customHeaders' 50 } 51 52 self._uri = None 53 self._http_port = None 54 self._https_port = None 55 self._custom_headers = None 56 57 @property 58 def uri(self): 59 """ 60 **[Required]** Gets the uri of this Origin. 61 The URI of the origin. Does not support paths. Port numbers should be specified in the `httpPort` and `httpsPort` fields. 62 63 64 :return: The uri of this Origin. 65 :rtype: str 66 """ 67 return self._uri 68 69 @uri.setter 70 def uri(self, uri): 71 """ 72 Sets the uri of this Origin. 73 The URI of the origin. Does not support paths. Port numbers should be specified in the `httpPort` and `httpsPort` fields. 74 75 76 :param uri: The uri of this Origin. 77 :type: str 78 """ 79 self._uri = uri 80 81 @property 82 def http_port(self): 83 """ 84 Gets the http_port of this Origin. 85 The HTTP port on the origin that the web application listens on. If unspecified, defaults to `80`. If `0` is specified - the origin is not used for HTTP traffic. 86 87 88 :return: The http_port of this Origin. 89 :rtype: int 90 """ 91 return self._http_port 92 93 @http_port.setter 94 def http_port(self, http_port): 95 """ 96 Sets the http_port of this Origin. 97 The HTTP port on the origin that the web application listens on. If unspecified, defaults to `80`. If `0` is specified - the origin is not used for HTTP traffic. 98 99 100 :param http_port: The http_port of this Origin. 101 :type: int 102 """ 103 self._http_port = http_port 104 105 @property 106 def https_port(self): 107 """ 108 Gets the https_port of this Origin. 109 The HTTPS port on the origin that the web application listens on. If unspecified, defaults to `443`. If `0` is specified - the origin is not used for HTTPS traffic. 110 111 112 :return: The https_port of this Origin. 113 :rtype: int 114 """ 115 return self._https_port 116 117 @https_port.setter 118 def https_port(self, https_port): 119 """ 120 Sets the https_port of this Origin. 121 The HTTPS port on the origin that the web application listens on. If unspecified, defaults to `443`. If `0` is specified - the origin is not used for HTTPS traffic. 122 123 124 :param https_port: The https_port of this Origin. 125 :type: int 126 """ 127 self._https_port = https_port 128 129 @property 130 def custom_headers(self): 131 """ 132 Gets the custom_headers of this Origin. 133 A list of HTTP headers to forward to your origin. 134 135 136 :return: The custom_headers of this Origin. 137 :rtype: list[oci.waas.models.Header] 138 """ 139 return self._custom_headers 140 141 @custom_headers.setter 142 def custom_headers(self, custom_headers): 143 """ 144 Sets the custom_headers of this Origin. 145 A list of HTTP headers to forward to your origin. 146 147 148 :param custom_headers: The custom_headers of this Origin. 149 :type: list[oci.waas.models.Header] 150 """ 151 self._custom_headers = custom_headers 152 153 def __repr__(self): 154 return formatted_flat_dict(self) 155 156 def __eq__(self, other): 157 if other is None: 158 return False 159 160 return self.__dict__ == other.__dict__ 161 162 def __ne__(self, other): 163 return not self == other 164