AsposeCellsCloud-CellsApi

 view release on metacpan or  search on metacpan

lib/AsposeCellsCloud/ApiClient.pm  view on Meta::CPAN

    my ($self, %args) = @_;
    if(!$self->need_auth()){
        return;
    }
    if($self->{get_access_token_time}){
        my $difference_in_seconds=time() - $self->{get_access_token_time};
        if($difference_in_seconds < 86300){
            return;
        }
    }
    my $access_token  =  $self->o_auth_post('grant_type' => "client_credentials", 'client_id' => $self->{config}->{client_id}, 'client_secret' =>$self->{config}->{client_secret})->access_token;
    $self->{config}->{access_token} = $access_token;
}

# make the HTTP request
# @param string $resourcePath path to method endpoint
# @param string $method method to call
# @param array $queryParams parameters to be place in query URL
# @param array $postData parameters to be placed in POST body
# @param array $headerParams parameters to be place in request header
# @return mixed

lib/AsposeCellsCloud/CellsApi.pm  view on Meta::CPAN

    my $class = shift;
    my $api_client;

    if ($_[0] && ref $_[0] && ref $_[0] eq 'AsposeCellsCloud::ApiClient' ) {
        $api_client = $_[0];
    } else {
        $api_client = AsposeCellsCloud::ApiClient->new(@_);
    }

    if($api_client->need_auth()){
        my $access_token  =  $api_client->o_auth_post('grant_type' => "client_credentials", 'client_id' => $api_client->{config}->{client_id}, 'client_secret' =>$api_client->{config}->{client_secret})->access_token;
        $api_client->{config}->{access_token} = $access_token;
    }

    bless { api_client => $api_client }, $class;

}

#
# PostAccessTokenRequest
#



( run in 0.229 second using v1.01-cache-2.11-cpan-4d50c553e7e )