Skip to content

Latest commit

 

History

History
389 lines (264 loc) · 12.3 KB

File metadata and controls

389 lines (264 loc) · 12.3 KB

cloudflare_dart.api.AccountOwnedAPITokensApi

Load the API package

import 'package:cloudflare_dart/api.dart';

All URIs are relative to https://api.cloudflare.com/client/v4

Method HTTP request Description
accountApiTokensCreateToken POST /accounts/{account_id}/tokens Create Token
accountApiTokensDeleteToken DELETE /accounts/{account_id}/tokens/{token_id} Delete Token
accountApiTokensListPermissionGroups GET /accounts/{account_id}/tokens/permission_groups List Permission Groups
accountApiTokensListTokens GET /accounts/{account_id}/tokens List Tokens
accountApiTokensRollToken PUT /accounts/{account_id}/tokens/{token_id}/value Roll Token
accountApiTokensTokenDetails GET /accounts/{account_id}/tokens/{token_id} Token Details
accountApiTokensUpdateToken PUT /accounts/{account_id}/tokens/{token_id} Update Token
accountApiTokensVerifyToken GET /accounts/{account_id}/tokens/verify Verify Token

accountApiTokensCreateToken

IamSingleTokenCreateResponse accountApiTokensCreateToken(accountId, iamCreatePayload)

Create Token

Create a new Account Owned API token.

Example

import 'package:cloudflare_dart/api.dart';

final api = CloudflareDart().getAccountOwnedAPITokensApi();
final IamAccountIdentifier accountId = ; // IamAccountIdentifier | 
final IamCreatePayload iamCreatePayload = ; // IamCreatePayload | 

try {
    final response = api.accountApiTokensCreateToken(accountId, iamCreatePayload);
    print(response);
} catch on DioException (e) {
    print('Exception when calling AccountOwnedAPITokensApi->accountApiTokensCreateToken: $e\n');
}

Parameters

Name Type Description Notes
accountId IamAccountIdentifier
iamCreatePayload IamCreatePayload

Return type

IamSingleTokenCreateResponse

Authorization

api_token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

accountApiTokensDeleteToken

IamApiResponseSingleId accountApiTokensDeleteToken(accountId, tokenId)

Delete Token

Destroy an Account Owned API token.

Example

import 'package:cloudflare_dart/api.dart';

final api = CloudflareDart().getAccountOwnedAPITokensApi();
final IamAccountIdentifier accountId = ; // IamAccountIdentifier | 
final String tokenId = tokenId_example; // String | 

try {
    final response = api.accountApiTokensDeleteToken(accountId, tokenId);
    print(response);
} catch on DioException (e) {
    print('Exception when calling AccountOwnedAPITokensApi->accountApiTokensDeleteToken: $e\n');
}

Parameters

Name Type Description Notes
accountId IamAccountIdentifier
tokenId String

Return type

IamApiResponseSingleId

Authorization

api_token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

accountApiTokensListPermissionGroups

IamPermissionsGroupResponseCollection accountApiTokensListPermissionGroups(accountId, name, scope)

List Permission Groups

Find all available permission groups for Account Owned API Tokens

Example

import 'package:cloudflare_dart/api.dart';

final api = CloudflareDart().getAccountOwnedAPITokensApi();
final IamAccountIdentifier accountId = ; // IamAccountIdentifier | 
final String name = Account%20Settings%20Write; // String | Filter by the name of the permission group. The value must be URL-encoded.
final String scope = com.cloudflare.api.account.zone; // String | Filter by the scope of the permission group. The value must be URL-encoded.

try {
    final response = api.accountApiTokensListPermissionGroups(accountId, name, scope);
    print(response);
} catch on DioException (e) {
    print('Exception when calling AccountOwnedAPITokensApi->accountApiTokensListPermissionGroups: $e\n');
}

Parameters

Name Type Description Notes
accountId IamAccountIdentifier
name String Filter by the name of the permission group. The value must be URL-encoded. [optional]
scope String Filter by the scope of the permission group. The value must be URL-encoded. [optional]

Return type

IamPermissionsGroupResponseCollection

Authorization

api_token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

accountApiTokensListTokens

IamCollectionTokensResponse accountApiTokensListTokens(accountId, page, perPage, direction)

List Tokens

List all Account Owned API tokens created for this account.

Example

import 'package:cloudflare_dart/api.dart';

final api = CloudflareDart().getAccountOwnedAPITokensApi();
final IamAccountIdentifier accountId = ; // IamAccountIdentifier | 
final num page = 8.14; // num | 
final num perPage = 8.14; // num | 
final String direction = desc; // String | 

try {
    final response = api.accountApiTokensListTokens(accountId, page, perPage, direction);
    print(response);
} catch on DioException (e) {
    print('Exception when calling AccountOwnedAPITokensApi->accountApiTokensListTokens: $e\n');
}

Parameters

Name Type Description Notes
accountId IamAccountIdentifier
page num [optional] [default to 1]
perPage num [optional] [default to 20]
direction String [optional]

Return type

IamCollectionTokensResponse

Authorization

api_token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

accountApiTokensRollToken

IamResponseSingleValue accountApiTokensRollToken(accountId, tokenId, body)

Roll Token

Roll the Account Owned API token secret.

Example

import 'package:cloudflare_dart/api.dart';

final api = CloudflareDart().getAccountOwnedAPITokensApi();
final IamAccountIdentifier accountId = ; // IamAccountIdentifier | 
final String tokenId = tokenId_example; // String | 
final JsonObject body = Object; // JsonObject | 

try {
    final response = api.accountApiTokensRollToken(accountId, tokenId, body);
    print(response);
} catch on DioException (e) {
    print('Exception when calling AccountOwnedAPITokensApi->accountApiTokensRollToken: $e\n');
}

Parameters

Name Type Description Notes
accountId IamAccountIdentifier
tokenId String
body JsonObject

Return type

IamResponseSingleValue

Authorization

api_token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

accountApiTokensTokenDetails

IamSingleTokenResponse accountApiTokensTokenDetails(accountId, tokenId)

Token Details

Get information about a specific Account Owned API token.

Example

import 'package:cloudflare_dart/api.dart';

final api = CloudflareDart().getAccountOwnedAPITokensApi();
final IamAccountIdentifier accountId = ; // IamAccountIdentifier | 
final String tokenId = tokenId_example; // String | 

try {
    final response = api.accountApiTokensTokenDetails(accountId, tokenId);
    print(response);
} catch on DioException (e) {
    print('Exception when calling AccountOwnedAPITokensApi->accountApiTokensTokenDetails: $e\n');
}

Parameters

Name Type Description Notes
accountId IamAccountIdentifier
tokenId String

Return type

IamSingleTokenResponse

Authorization

api_token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

accountApiTokensUpdateToken

IamSingleTokenResponse accountApiTokensUpdateToken(accountId, tokenId, iamTokenBody)

Update Token

Update an existing token.

Example

import 'package:cloudflare_dart/api.dart';

final api = CloudflareDart().getAccountOwnedAPITokensApi();
final IamAccountIdentifier accountId = ; // IamAccountIdentifier | 
final String tokenId = tokenId_example; // String | 
final IamTokenBody iamTokenBody = ; // IamTokenBody | 

try {
    final response = api.accountApiTokensUpdateToken(accountId, tokenId, iamTokenBody);
    print(response);
} catch on DioException (e) {
    print('Exception when calling AccountOwnedAPITokensApi->accountApiTokensUpdateToken: $e\n');
}

Parameters

Name Type Description Notes
accountId IamAccountIdentifier
tokenId String
iamTokenBody IamTokenBody

Return type

IamSingleTokenResponse

Authorization

api_token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

accountApiTokensVerifyToken

IamTokenVerifyResponseSingleSegment accountApiTokensVerifyToken(accountId)

Verify Token

Test whether a token works.

Example

import 'package:cloudflare_dart/api.dart';

final api = CloudflareDart().getAccountOwnedAPITokensApi();
final IamAccountIdentifier accountId = ; // IamAccountIdentifier | 

try {
    final response = api.accountApiTokensVerifyToken(accountId);
    print(response);
} catch on DioException (e) {
    print('Exception when calling AccountOwnedAPITokensApi->accountApiTokensVerifyToken: $e\n');
}

Parameters

Name Type Description Notes
accountId IamAccountIdentifier

Return type

IamTokenVerifyResponseSingleSegment

Authorization

api_token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]