olp-cpp-sdk  1.21.0
Public Types | Public Member Functions | Static Public Member Functions | List of all members
olp::client::HRN Class Reference

Allows a Here Resource Name (HRN) to be passed to the operations that require it. More...

#include <HRN.h>

Public Types

enum  ServiceType { Unknown , Data , Schema , Pipeline }
 Defines the objects to which the HRN can refer. More...
 

Public Member Functions

 HRN ()=default
 Default constructor which creates an empty invalid HRN.
 
 HRN (const std::string &input)
 Creates the HRN instance from a string. More...
 
bool operator== (const HRN &rhs) const
 Checks whether the values of the HRN parameter are the same as the values of the rhs parameter. More...
 
bool operator!= (const HRN &rhs) const
 Checks whether the values of the HRN parameter are not the same as the values of the rhs parameter. More...
 
 operator bool () const
 Checks whether the service type fields of the HRN instance are not empty. More...
 
bool IsNull () const
 Checks whether any of the service type fields of the HRN instance are empty. More...
 
std::string ToString () const
 Converts this HRN to a string. More...
 
std::string ToCatalogHRNString () const
 Converts this HRN to a string catalog ID. More...
 
const std::string & GetPartition () const
 Returns the partitions of this HRN. More...
 
ServiceType GetService () const
 Returns the service type of this HRN. More...
 
const std::string & GetRegion () const
 Returns the region of this HRN. More...
 
const std::string & GetAccount () const
 Returns the account of this HRN. More...
 
const std::string & GetCatalogId () const
 Returns the catalog ID. More...
 
const std::string & GetLayerId () const
 Returns the layer ID. More...
 
const std::string & GetGroupId () const
 Returns the group ID. More...
 
const std::string & GetSchemaName () const
 Retruns the schema name. More...
 
const std::string & GetVersion () const
 Returns the catalog version. More...
 
const std::string & GetPipelineId () const
 Returns the pipeline ID. More...
 

Static Public Member Functions

static HRN FromString (const std::string &input)
 Creates the HRN instance from a string. More...
 
static std::unique_ptr< HRNUniqueFromString (const std::string &input)
 Creates the unique HRN instance from a string. More...
 

Detailed Description

Allows a Here Resource Name (HRN) to be passed to the operations that require it.

Member Enumeration Documentation

◆ ServiceType

Defines the objects to which the HRN can refer.

Enumerator
Unknown 

The service type is unknown.

Data 

This HRN represents the data catalog.

Schema 

This HRN represents the schema type.

Pipeline 

This HRN represents the pipeline instance.

Constructor & Destructor Documentation

◆ HRN()

olp::client::HRN::HRN ( const std::string &  input)
explicit

Creates the HRN instance from a string.

The passed string must start with hrn:.

Parameters
inputThe HRN string.

Member Function Documentation

◆ FromString()

static HRN olp::client::HRN::FromString ( const std::string &  input)
static

Creates the HRN instance from a string.

The passed string must start with hrn:.

Parameters
inputThe HRN string.
Returns
The HRN instance created from the string.

◆ GetAccount()

const std::string& olp::client::HRN::GetAccount ( ) const
inline

Returns the account of this HRN.

Returns
The account associated with this HRN.

◆ GetCatalogId()

const std::string& olp::client::HRN::GetCatalogId ( ) const
inline

Returns the catalog ID.

Note
Must be valid in case ServiceType == Data.
Returns
The catalog ID.

◆ GetGroupId()

const std::string& olp::client::HRN::GetGroupId ( ) const
inline

Returns the group ID.

Returns
The group ID or a empty string in case ServiceType != Schema.

◆ GetLayerId()

const std::string& olp::client::HRN::GetLayerId ( ) const
inline

Returns the layer ID.

Note
This parameter is optional and not always used.
Returns
The layer ID or a empty string if not set.

◆ GetPartition()

const std::string& olp::client::HRN::GetPartition ( ) const
inline

Returns the partitions of this HRN.

Note
Must be valid when ServiceType == Data or when ServiceType == Pipeline.
Returns
The partition of this HRN.

◆ GetPipelineId()

const std::string& olp::client::HRN::GetPipelineId ( ) const
inline

Returns the pipeline ID.

Returns
The pipeline ID or and empty string in case HRNServiceType != Pipeline and ServiceType != Schema.

◆ GetRegion()

const std::string& olp::client::HRN::GetRegion ( ) const
inline

Returns the region of this HRN.

Returns
The region of this HRN.

◆ GetSchemaName()

const std::string& olp::client::HRN::GetSchemaName ( ) const
inline

Retruns the schema name.

Returns
The schema name or a empty string in case ServiceType != Schema.

◆ GetService()

ServiceType olp::client::HRN::GetService ( ) const
inline

Returns the service type of this HRN.

Returns
The service type enum.

◆ GetVersion()

const std::string& olp::client::HRN::GetVersion ( ) const
inline

Returns the catalog version.

Returns
The catalog version or a empty string in case ServiceType != Schema.

◆ IsNull()

bool olp::client::HRN::IsNull ( ) const

Checks whether any of the service type fields of the HRN instance are empty.

Returns
True if at least one of the service type fields of the HRN instance is empty; false otherwise.

◆ operator bool()

olp::client::HRN::operator bool ( ) const
explicit

Checks whether the service type fields of the HRN instance are not empty.

Returns
True if the service type fields of the HRN instance are not empty; false otherwise.

◆ operator!=()

bool olp::client::HRN::operator!= ( const HRN rhs) const

Checks whether the values of the HRN parameter are not the same as the values of the rhs parameter.

Parameters
rhsThe HRN instance.
Returns
True if the values of the HRN and rhs parameters are not equal; false otherwise.

◆ operator==()

bool olp::client::HRN::operator== ( const HRN rhs) const

Checks whether the values of the HRN parameter are the same as the values of the rhs parameter.

Parameters
rhsThe HRN instance.
Returns
True if the values of the HRN and rhs parameters are equal; false otherwise.

◆ ToCatalogHRNString()

std::string olp::client::HRN::ToCatalogHRNString ( ) const

Converts this HRN to a string catalog ID.

Note
Only relevant if the HRN has ServiceType == Data.
Returns
The catalog ID that has the hrn: prefix.

◆ ToString()

std::string olp::client::HRN::ToString ( ) const

Converts this HRN to a string.

Example: hrn:partition:service:region:account:resource

Returns
The HRN string that has the hrn: prefix.

◆ UniqueFromString()

static std::unique_ptr<HRN> olp::client::HRN::UniqueFromString ( const std::string &  input)
static

Creates the unique HRN instance from a string.

The passed string must start with hrn:.

Parameters
inputThe HRN string.
Returns
The unique HRN instance created from the string.

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