|
26 | 26 |
|
27 | 27 | namespace olp { |
28 | 28 | namespace client { |
29 | | -/// \brief The Here Resource Name (HRN) class, this allows HRN's to be passed to |
30 | | -/// the operations that require it. |
| 29 | + |
| 30 | +/** |
| 31 | + * @brief The Here Resource Name (HRN) class, this allows HRN's to be passed to |
| 32 | + * the operations that require it. |
| 33 | + */ |
31 | 34 | class CORE_API HRN { |
32 | 35 | public: |
33 | | - /// The ServiceType enum defines the different objects that a HRN can refer to |
| 36 | + /** |
| 37 | + * @brief The ServiceType enum defines the different objects that a HRN can |
| 38 | + * refer to. |
| 39 | + */ |
34 | 40 | enum ServiceType { |
35 | | - Unknown, ///< the service type is unknown |
36 | | - Data, ///< a data catalog |
37 | | - Schema, ///< a schema type |
38 | | - Pipeline ///< a pipeline instance |
| 41 | + Unknown, ///< The service type is unknown. |
| 42 | + Data, ///< This HRN represents a data catalog. |
| 43 | + Schema, ///< This HRN represents a schema type. |
| 44 | + Pipeline ///< This HRN represents a pipeline instance. |
39 | 45 | }; |
40 | 46 |
|
41 | | - /// the partition of the HRN |
| 47 | + /** |
| 48 | + * @brief Constructs a `HRN` from its string form. |
| 49 | + * |
| 50 | + * The passed string must start with "hrn:". |
| 51 | + * |
| 52 | + * @param input The `HRN` in string form. |
| 53 | + */ |
| 54 | + explicit HRN(const std::string& input); |
| 55 | + |
| 56 | + /** |
| 57 | + * @brief Constructs a new instance of `HRN` from its string form. |
| 58 | + * |
| 59 | + * The passed string must start with "hrn:". |
| 60 | + * |
| 61 | + * @param input The `HRN` in string form. |
| 62 | + * |
| 63 | + * @return A new instance of `HRN` created from string. |
| 64 | + */ |
| 65 | + static HRN FromString(const std::string& input); |
| 66 | + |
| 67 | + /** |
| 68 | + * @brief Constructs a unique instance of `HRN` from its string form. |
| 69 | + * |
| 70 | + * The passed string must start with "hrn:". |
| 71 | + * |
| 72 | + * @param input The `HRN` in string form. |
| 73 | + * |
| 74 | + * @return A new instance of `HRN` created from string. |
| 75 | + */ |
| 76 | + static std::unique_ptr<HRN> UniqueFromString(const std::string& input); |
| 77 | + |
| 78 | + HRN() = default; |
| 79 | + |
| 80 | + /** |
| 81 | + * @brief The HRN class equality operator. |
| 82 | + */ |
| 83 | + bool operator==(const HRN& rhs) const; |
| 84 | + |
| 85 | + /** |
| 86 | + * @brief The HRN class inequality operator. |
| 87 | + */ |
| 88 | + bool operator!=(const HRN& rhs) const; |
| 89 | + |
| 90 | + /** |
| 91 | + * @brief The HRN class bool operator. |
| 92 | + * |
| 93 | + * @return Returns true if this `HRN` instance has all service type relevant |
| 94 | + * fields not empty, false otherwise. |
| 95 | + */ |
| 96 | + explicit operator bool() const; |
| 97 | + |
| 98 | + /** |
| 99 | + * @brief Checks the internal status of the `HRN` instance. |
| 100 | + * |
| 101 | + * @return Returns true if this `HRN` instance has at least one of the service |
| 102 | + * type relevant fields empty, false otherwise. |
| 103 | + */ |
| 104 | + bool IsNull() const; |
| 105 | + |
| 106 | + /** |
| 107 | + * @brief Returns this `HRN` instance in its string form, prefixed with |
| 108 | + * "hrn:". |
| 109 | + */ |
| 110 | + std::string ToString() const; |
| 111 | + |
| 112 | + /** |
| 113 | + * @brief Returns this `HRN` instance in its string form for catalog ID, |
| 114 | + * prefixed with "hrn:". |
| 115 | + * |
| 116 | + * @note Only relevant for when the `HRN` has ServiceType == Data. |
| 117 | + */ |
| 118 | + std::string ToCatalogHRNString() const; |
| 119 | + |
| 120 | + /// The partition of the HRN, must be valid when ServiceType == Data or when |
| 121 | + /// when ServiceType == Pipeline |
| 122 | + /// @deprecated This field will be marked as private by 05.2020. |
42 | 123 | std::string partition; |
43 | | - /// the service of the HRN |
| 124 | + /// The service of the HRN. |
| 125 | + /// @deprecated This field will be marked as private by 05.2020. |
44 | 126 | ServiceType service{ServiceType::Unknown}; |
45 | | - /// the region of the HRN |
| 127 | + /// The region of the HRN. |
| 128 | + /// @deprecated This field will be marked as private by 05.2020. |
46 | 129 | std::string region; |
47 | | - /// the account of the HRN |
| 130 | + /// The account of the HRN. |
| 131 | + /// @deprecated This field will be marked as private by 05.2020. |
48 | 132 | std::string account; |
49 | 133 |
|
50 | | - /// Catalog ID, valid when HRNServiceType == Data |
| 134 | + /// The catalog ID, must be valid when ServiceType == Data. |
| 135 | + /// @deprecated This field will be marked as private by 05.2020. |
51 | 136 | std::string catalogId; |
52 | | - /// Layer ID, optional |
| 137 | + /// The layer ID, optional. |
| 138 | + /// @deprecated This field will be marked as private by 05.2020. |
53 | 139 | std::string layerId; |
54 | 140 |
|
55 | | - /// Group ID, valid when HRNServiceType == Schema |
| 141 | + /// The group ID, must be valid when ServiceType == Schema. |
| 142 | + /// @deprecated This field will be marked as private by 05.2020. |
56 | 143 | std::string groupId; |
57 | | - /// Schema Name |
| 144 | + /// The schema name, must be valid when ServiceType == Schema. |
| 145 | + /// @deprecated This field will be marked as private by 05.2020. |
58 | 146 | std::string schemaName; |
59 | | - /// Version |
| 147 | + /// The version, must be valid when ServiceType == Schema. |
| 148 | + /// @deprecated This field will be marked as private by 05.2020. |
60 | 149 | std::string version; |
61 | 150 |
|
62 | | - /// Pipeline ID, valid when HRNServiceType == Pipeline |
| 151 | + /// Pipeline ID, valid when ServiceType == Pipeline. |
| 152 | + /// @deprecated This field will be marked as private by 05.2020. |
63 | 153 | std::string pipelineId; |
64 | | - |
65 | | - /// \brief returns this HRN in its string form, prefixed with hrn: |
66 | | - std::string ToString() const; |
67 | | - |
68 | | - /// \brief returns this HRN in its string form for catalog ID, prefixed with |
69 | | - /// hrn: |
70 | | - std::string ToCatalogHRNString() const; |
71 | | - |
72 | | - /// \brief default constructor |
73 | | - HRN() = default; |
74 | | - |
75 | | - /// \brief constructs a HRN from its string form. Must start with "hrn:". |
76 | | - /// As a special case to support existing command line clients, http: and |
77 | | - /// https: are also accepted |
78 | | - explicit HRN(const std::string& input); |
79 | | - |
80 | | - /// \brief constructs a HRN from its string form. Must start with "hrn:". |
81 | | - /// As a special case to support existing command line clients, http: and |
82 | | - /// https: are also accepted |
83 | | - static HRN FromString(const std::string& input); |
84 | | - |
85 | | - /// \brief constructs a HRN from its string form. Must start with "hrn:". |
86 | | - /// As a special case to support existing command line clients, http: and |
87 | | - /// https: are also accepted |
88 | | - static std::unique_ptr<HRN> UniqueFromString(const std::string& input); |
89 | | - |
90 | | - /// \brief The HRN class equality operator |
91 | | - bool operator==(const HRN& other) const; |
92 | | - |
93 | | - /// \brief The HRN class inequality operator |
94 | | - bool operator!=(const HRN& other) const; |
95 | | - |
96 | | - /// \brief returns true if HRN is null (all fields empty), false otherwise |
97 | | - bool IsNull() const; |
98 | 154 | }; |
| 155 | + |
99 | 156 | } // namespace client |
100 | 157 | } // namespace olp |
0 commit comments