olp-cpp-sdk  1.22.0
Public Member Functions | List of all members
olp::dataservice::read::DataRequest Class Referencefinal

Encapsulates the fields required to request data for the given catalog, layer, and partition. More...

#include <DataRequest.h>

Public Member Functions

const boost::optional< std::string > & GetPartitionId () const
 Gets the ID of the requested partition. More...
 
DataRequestWithPartitionId (boost::optional< std::string > partition_id)
 Sets the partition ID. More...
 
DataRequestWithPartitionId (std::string &&partition_id)
 Sets the partition ID. More...
 
const boost::optional< std::string > & GetDataHandle () const
 Get the partition data handle. More...
 
DataRequestWithDataHandle (boost::optional< std::string > data_handle)
 Sets the partition data handle. More...
 
DataRequestWithDataHandle (std::string &&data_handle)
 Sets the partition data handle. More...
 
const boost::optional< std::string > & GetBillingTag () const
 Gets the billing tag to group billing records together. More...
 
DataRequestWithBillingTag (boost::optional< std::string > tag)
 Sets the billing tag for the request. More...
 
DataRequestWithBillingTag (std::string &&tag)
 Sets the billing tag for the request. More...
 
FetchOptions GetFetchOption () const
 Gets the fetch option that controls how requests are handled. More...
 
DataRequestWithFetchOption (FetchOptions fetch_option)
 Sets the fetch option that you can use to set the source from which data should be fetched. More...
 
uint32_t GetPriority () const
 Gets the request priority. More...
 
DataRequestWithPriority (uint32_t priority)
 Sets the priority of the request. More...
 
std::string CreateKey (const std::string &layer_id, boost::optional< int64_t > version) const
 Creates a readable format for the request. More...
 

Detailed Description

Encapsulates the fields required to request data for the given catalog, layer, and partition.

You should specify either a partition ID or a data handle. If both the partition ID and data handle are set in the request, the request fails with the following error: ErrorCode::PreconditionFailed.

Member Function Documentation

◆ CreateKey()

std::string olp::dataservice::read::DataRequest::CreateKey ( const std::string &  layer_id,
boost::optional< int64_t >  version 
) 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.

◆ GetBillingTag()

const boost::optional<std::string>& olp::dataservice::read::DataRequest::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.

◆ GetDataHandle()

const boost::optional<std::string>& olp::dataservice::read::DataRequest::GetDataHandle ( ) const
inline

Get the partition data handle.

You can use the data handle to retrieve the data that relates to this partition. The data handle identifies a specific blob so that you can request the blob contents with the Blob API. When requesting data from the Blob API, you must specify the catalog ID, layer ID, and data handle.

Returns
The partition data handle.

◆ GetFetchOption()

FetchOptions olp::dataservice::read::DataRequest::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.

◆ GetPartitionId()

const boost::optional<std::string>& olp::dataservice::read::DataRequest::GetPartitionId ( ) const
inline

Gets the ID of the requested partition.

Returns
The partition ID.

◆ GetPriority()

uint32_t olp::dataservice::read::DataRequest::GetPriority ( ) const
inline

Gets the request priority.

The default priority is Priority::NORMAL.

Returns
The request priority.

◆ WithBillingTag() [1/2]

DataRequest& olp::dataservice::read::DataRequest::WithBillingTag ( boost::optional< std::string >  tag)
inline

Sets the billing tag for the request.

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

◆ WithBillingTag() [2/2]

DataRequest& olp::dataservice::read::DataRequest::WithBillingTag ( std::string &&  tag)
inline

Sets the billing tag for the request.

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

◆ WithDataHandle() [1/2]

DataRequest& olp::dataservice::read::DataRequest::WithDataHandle ( boost::optional< std::string >  data_handle)
inline

Sets the partition data handle.

If the data handle cannot be found in the layer, the callback returns with an empty response (the null result for data and an error).

See also
GetDataHandle for information on the partition data handle.
Parameters
data_handleThe partition data handle.
Returns
A reference to the updated DataRequest instance.

◆ WithDataHandle() [2/2]

DataRequest& olp::dataservice::read::DataRequest::WithDataHandle ( std::string &&  data_handle)
inline

Sets the partition data handle.

If the data handle cannot be found in the layer, the callback returns with an empty response (the null result for data and an error).

See also
GetDataHandle for information on the partition data handle.
Parameters
data_handleThe partition data handle.
Returns
A reference to the updated DataRequest instance.

◆ WithFetchOption()

DataRequest& olp::dataservice::read::DataRequest::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 DataRequest instance.

◆ WithPartitionId() [1/2]

DataRequest& olp::dataservice::read::DataRequest::WithPartitionId ( boost::optional< std::string >  partition_id)
inline

Sets the partition ID.

If the partition cannot be found in the layer, the callback returns with an empty response (the null result for data and an error).

Parameters
partition_idThe partition ID.
Returns
A reference to the updated DataRequest instance.

◆ WithPartitionId() [2/2]

DataRequest& olp::dataservice::read::DataRequest::WithPartitionId ( std::string &&  partition_id)
inline

Sets the partition ID.

If the partition cannot be found in the layer, the callback returns with an empty response (the null result for data and an error).

Parameters
partition_idThe partition ID.
Returns
A reference to the updated DataRequest instance.

◆ WithPriority()

DataRequest& olp::dataservice::read::DataRequest::WithPriority ( uint32_t  priority)
inline

Sets the priority of the request.

Parameters
priorityThe priority of the request.
Returns
A reference to the updated DataRequest instance.

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