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 SSECustomerKeyDetails(object):
12    """
13    Specifies the details of the customer-provided encryption key (SSE-C) associated with an object.
14    """
15
16    #: A constant which can be used with the algorithm property of a SSECustomerKeyDetails.
17    #: This constant has a value of "AES256"
18    ALGORITHM_AES256 = "AES256"
19
20    def __init__(self, **kwargs):
21        """
22        Initializes a new SSECustomerKeyDetails object with values from keyword arguments.
23        The following keyword arguments are supported (corresponding to the getters/setters of this class):
24
25        :param algorithm:
26            The value to assign to the algorithm property of this SSECustomerKeyDetails.
27            Allowed values for this property are: "AES256"
28        :type algorithm: str
29
30        :param key:
31            The value to assign to the key property of this SSECustomerKeyDetails.
32        :type key: str
33
34        :param key_sha256:
35            The value to assign to the key_sha256 property of this SSECustomerKeyDetails.
36        :type key_sha256: str
37
38        """
39        self.swagger_types = {
40            'algorithm': 'str',
41            'key': 'str',
42            'key_sha256': 'str'
43        }
44
45        self.attribute_map = {
46            'algorithm': 'algorithm',
47            'key': 'key',
48            'key_sha256': 'keySha256'
49        }
50
51        self._algorithm = None
52        self._key = None
53        self._key_sha256 = None
54
55    @property
56    def algorithm(self):
57        """
58        **[Required]** Gets the algorithm of this SSECustomerKeyDetails.
59        Specifies the encryption algorithm. The only supported value is \"AES256\".
60
61        Allowed values for this property are: "AES256"
62
63
64        :return: The algorithm of this SSECustomerKeyDetails.
65        :rtype: str
66        """
67        return self._algorithm
68
69    @algorithm.setter
70    def algorithm(self, algorithm):
71        """
72        Sets the algorithm of this SSECustomerKeyDetails.
73        Specifies the encryption algorithm. The only supported value is \"AES256\".
74
75
76        :param algorithm: The algorithm of this SSECustomerKeyDetails.
77        :type: str
78        """
79        allowed_values = ["AES256"]
80        if not value_allowed_none_or_none_sentinel(algorithm, allowed_values):
81            raise ValueError(
82                "Invalid value for `algorithm`, must be None or one of {0}"
83                .format(allowed_values)
84            )
85        self._algorithm = algorithm
86
87    @property
88    def key(self):
89        """
90        **[Required]** Gets the key of this SSECustomerKeyDetails.
91        Specifies the base64-encoded 256-bit encryption key to use to encrypt or decrypt the object data.
92
93
94        :return: The key of this SSECustomerKeyDetails.
95        :rtype: str
96        """
97        return self._key
98
99    @key.setter
100    def key(self, key):
101        """
102        Sets the key of this SSECustomerKeyDetails.
103        Specifies the base64-encoded 256-bit encryption key to use to encrypt or decrypt the object data.
104
105
106        :param key: The key of this SSECustomerKeyDetails.
107        :type: str
108        """
109        self._key = key
110
111    @property
112    def key_sha256(self):
113        """
114        **[Required]** Gets the key_sha256 of this SSECustomerKeyDetails.
115        Specifies the base64-encoded SHA256 hash of the encryption key. This value is used to check the integrity
116        of the encryption key.
117
118
119        :return: The key_sha256 of this SSECustomerKeyDetails.
120        :rtype: str
121        """
122        return self._key_sha256
123
124    @key_sha256.setter
125    def key_sha256(self, key_sha256):
126        """
127        Sets the key_sha256 of this SSECustomerKeyDetails.
128        Specifies the base64-encoded SHA256 hash of the encryption key. This value is used to check the integrity
129        of the encryption key.
130
131
132        :param key_sha256: The key_sha256 of this SSECustomerKeyDetails.
133        :type: str
134        """
135        self._key_sha256 = key_sha256
136
137    def __repr__(self):
138        return formatted_flat_dict(self)
139
140    def __eq__(self, other):
141        if other is None:
142            return False
143
144        return self.__dict__ == other.__dict__
145
146    def __ne__(self, other):
147        return not self == other
148