olp-cpp-sdk  1.22.0
Public Types | Public Member Functions | Static Public Attributes | List of all members
olp::dataservice::read::PartitionsRequest Class Referencefinal

Encapsulates the fields required to request a list of partitions for the given catalog and layer. More...

#include <PartitionsRequest.h>

Public Types

using PartitionIds = std::vector< std::string >
 An alias for the vector of partitions IDs.
 
using AdditionalFields = std::vector< std::string >
 An alias for the set of additional fields.
 

Public Member Functions

PartitionsRequestWithPartitionIds (PartitionIds partition_ids)
 Sets the list of partitions. More...
 
const PartitionIdsGetPartitionIds () const
 Gets the list of the partitions. More...
 
PartitionsRequestWithAdditionalFields (AdditionalFields additional_fields)
 Sets the list of additional fields. More...
 
const AdditionalFieldsGetAdditionalFields () const
 Gets the list of additional fields. More...
 
const boost::optional< std::string > & GetBillingTag () const
 Gets the billing tag to group billing records together. More...
 
PartitionsRequestWithBillingTag (boost::optional< std::string > billingTag)
 Sets the billing tag for the request. More...
 
PartitionsRequestWithBillingTag (std::string &&billingTag)
 Sets the billing tag for the request. More...
 
FetchOptions GetFetchOption () const
 Gets the fetch option that controls how requests are handled. More...
 
PartitionsRequestWithFetchOption (FetchOptions fetch_option)
 Sets the fetch option that you can use to set the source from which data should be fetched. More...
 
std::string CreateKey (const std::string &layer_id, boost::optional< int64_t > version=boost::none) const
 Creates a readable format for the request. More...
 

Static Public Attributes

static constexpr const char * kDataSize = "dataSize"
 Additional field to request partition data size, see GetPartitions.
 
static constexpr const char * kChecksum = "checksum"
 Additional field to request partition checksum, see GetPartitions.
 
static constexpr const char * kCompressedDataSize = "compressedDataSize"
 
static constexpr const char * kCrc = "crc"
 Additional field to request partition crc, see GetPartitions.
 

Detailed Description

Encapsulates the fields required to request a list of partitions for the given catalog and layer.

Member Function Documentation

◆ CreateKey()

std::string olp::dataservice::read::PartitionsRequest::CreateKey ( const std::string &  layer_id,
boost::optional< int64_t >  version = boost::none 
) const
inline

Creates a readable format for the request.

Parameters
layer_idThe ID of the layer that is used for the request.
versionThe catalog version.
Returns
A string representation of the request.

◆ GetAdditionalFields()

const AdditionalFields& olp::dataservice::read::PartitionsRequest::GetAdditionalFields ( ) const
inline

Gets the list of additional fields.

Returns
The set of additional fields.

◆ GetBillingTag()

const boost::optional<std::string>& olp::dataservice::read::PartitionsRequest::GetBillingTag ( ) const
inline

Gets the billing tag to group billing records together.

The billing tag is an optional free-form tag that is used for grouping billing records together. If supplied, it must be 4–16 characters long and contain only alphanumeric ASCII characters [A-Za-z0-9].

Returns
The BillingTag string or boost::none if the billing tag is not set.

◆ GetFetchOption()

FetchOptions olp::dataservice::read::PartitionsRequest::GetFetchOption ( ) const
inline

Gets the fetch option that controls how requests are handled.

The default option is OnlineIfNotFound that queries the network if the requested resource is not in the cache.

Returns
The fetch option.

◆ GetPartitionIds()

const PartitionIds& olp::dataservice::read::PartitionsRequest::GetPartitionIds ( ) const
inline

Gets the list of the partitions.

Returns
The vector of strings that represent partitions.

◆ WithAdditionalFields()

PartitionsRequest& olp::dataservice::read::PartitionsRequest::WithAdditionalFields ( AdditionalFields  additional_fields)
inline

Sets the list of additional fields.

When specified, the result metadata will include the additional information requested. The supported fields are:

  • dataSize
  • checksum
  • compressedDataSize
  • crc
Parameters
additional_fieldsThe list of additional fields.
Returns
A reference to the updated PartitionsRequest instance.

◆ WithBillingTag() [1/2]

PartitionsRequest& olp::dataservice::read::PartitionsRequest::WithBillingTag ( boost::optional< std::string >  billingTag)
inline

Sets the billing tag for the request.

See also
GetBillingTag() for information on usage and format.
Parameters
billingTagThe BillingTag string or boost::none.
Returns
A reference to the updated PrefetchTilesRequest instance.

◆ WithBillingTag() [2/2]

PartitionsRequest& olp::dataservice::read::PartitionsRequest::WithBillingTag ( std::string &&  billingTag)
inline

Sets the billing tag for the request.

See also
GetBillingTag() for information on usage and format.
Parameters
billingTagThe rvalue reference to the BillingTag string or boost::none.
Returns
A reference to the updated PrefetchTilesRequest instance.

◆ WithFetchOption()

PartitionsRequest& olp::dataservice::read::PartitionsRequest::WithFetchOption ( FetchOptions  fetch_option)
inline

Sets the fetch option that you can use to set the source from which data should be fetched.

See also
GetFetchOption() for information on usage and format.
Parameters
fetch_optionThe FetchOption enum.
Returns
A reference to the updated PrefetchTilesRequest instance.

◆ WithPartitionIds()

PartitionsRequest& olp::dataservice::read::PartitionsRequest::WithPartitionIds ( PartitionIds  partition_ids)
inline

Sets the list of partitions.

When the list is empty, the GetPartitions method will download the whole layer metadata. Additionally, a single request supports up to 100 partitions.

Parameters
partition_idsThe list of partitions to request.
Returns
A reference to the updated PartitionsRequest instance.

Member Data Documentation

◆ kCompressedDataSize

constexpr const char* olp::dataservice::read::PartitionsRequest::kCompressedDataSize = "compressedDataSize"
staticconstexpr

Additional field to request partition compressed data size, see GetPartitions


The documentation for this class was generated from the following file: