|
| 1 | +/* |
| 2 | + * -------------------------------------------------------------------------------- |
| 3 | + * <copyright company="Aspose" file="public_key_response.dart"> |
| 4 | + * Copyright (c) 2021 Aspose.Words for Cloud |
| 5 | + * </copyright> |
| 6 | + * <summary> |
| 7 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 8 | + * of this software and associated documentation files (the "Software"), to deal |
| 9 | + * in the Software without restriction, including without limitation the rights |
| 10 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 11 | + * copies of the Software, and to permit persons to whom the Software is |
| 12 | + * furnished to do so, subject to the following conditions: |
| 13 | + * |
| 14 | + * The above copyright notice and this permission notice shall be included in all |
| 15 | + * copies or substantial portions of the Software. |
| 16 | + * |
| 17 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 18 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 20 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 21 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 22 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 23 | + * SOFTWARE. |
| 24 | + * </summary> |
| 25 | + * -------------------------------------------------------------------------------- |
| 26 | + */ |
| 27 | + |
| 28 | +library aspose_words_cloud; |
| 29 | + |
| 30 | +import '../../aspose_words_cloud.dart'; |
| 31 | + |
| 32 | +/// REST response for RSA public key info. |
| 33 | +class PublicKeyResponse extends WordsResponse { |
| 34 | + /// Gets or sets RSA key exponent as Base64 string. |
| 35 | + String exponent; |
| 36 | + |
| 37 | + /// Gets or sets RSA key modulus as Base64 string. |
| 38 | + String modulus; |
| 39 | + |
| 40 | + @override |
| 41 | + void deserialize(Map<String, dynamic> json) { |
| 42 | + if (json == null) { |
| 43 | + throw ApiException(400, 'Failed to deserialize PublicKeyResponse data model.'); |
| 44 | + } |
| 45 | + |
| 46 | + super.deserialize(json); |
| 47 | + if (json.containsKey('Exponent')) { |
| 48 | + exponent = json['Exponent'] as String; |
| 49 | + } else { |
| 50 | + exponent = null; |
| 51 | + } |
| 52 | + |
| 53 | + if (json.containsKey('Modulus')) { |
| 54 | + modulus = json['Modulus'] as String; |
| 55 | + } else { |
| 56 | + modulus = null; |
| 57 | + } |
| 58 | + } |
| 59 | + |
| 60 | + @override |
| 61 | + Map<String, dynamic> serialize() { |
| 62 | + var _result = <String, dynamic>{}; |
| 63 | + _result.addAll(super.serialize()); |
| 64 | + if (exponent != null) { |
| 65 | + _result['Exponent'] = exponent; |
| 66 | + } |
| 67 | + |
| 68 | + if (modulus != null) { |
| 69 | + _result['Modulus'] = modulus; |
| 70 | + } |
| 71 | + return _result; |
| 72 | + } |
| 73 | +} |
| 74 | + |
| 75 | + |
0 commit comments