olp-cpp-sdk  1.22.0
CompatibleVersionsRequest.h
1 /*
2  * Copyright (C) 2022 HERE Europe B.V.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * SPDX-License-Identifier: Apache-2.0
17  * License-Filename: LICENSE
18  */
19 
20 #pragma once
21 
22 #include <olp/dataservice/read/DataServiceReadApi.h>
23 #include <olp/dataservice/read/model/CatalogVersion.h>
24 
25 #include <utility>
26 #include <vector>
27 
28 namespace olp {
29 namespace dataservice {
30 namespace read {
31 
36 class DATASERVICE_READ_API CompatibleVersionsRequest final {
37  public:
38  using Dependencies = std::vector<model::CatalogVersion>;
39 
45  inline const Dependencies& GetDependencies() const { return dependencies_; }
46 
57  Dependencies dependencies) {
58  dependencies_ = std::move(dependencies);
59  return *this;
60  }
61 
67  inline int32_t GetLimit() const { return limit_; }
68 
78  inline CompatibleVersionsRequest& WithLimit(int32_t limit) {
79  limit_ = limit;
80  return *this;
81  }
82 
83  private:
84  Dependencies dependencies_;
85  int32_t limit_{1};
86 };
87 
88 } // namespace read
89 } // namespace dataservice
90 } // namespace olp
Contains fields required to request compatible versions for the given catalog.
Definition: CompatibleVersionsRequest.h:36
const Dependencies & GetDependencies() const
Gets the dependencies for the catalog versions compatibility check.
Definition: CompatibleVersionsRequest.h:45
CompatibleVersionsRequest & WithLimit(int32_t limit)
Sets the maximum amount of versions available in the response.
Definition: CompatibleVersionsRequest.h:78
int32_t GetLimit() const
Gets the maximum amount of versions available in the response.
Definition: CompatibleVersionsRequest.h:67
CompatibleVersionsRequest & WithDependencies(Dependencies dependencies)
Sets the dependencies to check the catalog versions for compatibility.
Definition: CompatibleVersionsRequest.h:56
Rules all the other namespaces.
Definition: AppleSignInProperties.h:24