Table of Contents

Class CreateTempCredentialsRequest

Namespace
Cloudflare.NET.Accounts.Models
Assembly
Cloudflare.NET.dll

Defines the request payload for creating temporary R2 access credentials.

public record CreateTempCredentialsRequest : IEquatable<CreateTempCredentialsRequest>
Inheritance
CreateTempCredentialsRequest
Implements
Inherited Members

Constructors

CreateTempCredentialsRequest(string, string, TempCredentialPermission, int, IReadOnlyList<string>?, IReadOnlyList<string>?)

Defines the request payload for creating temporary R2 access credentials.

public CreateTempCredentialsRequest(string Bucket, string ParentAccessKeyId, TempCredentialPermission Permission, int TtlSeconds, IReadOnlyList<string>? Objects = null, IReadOnlyList<string>? Prefixes = null)

Parameters

Bucket string

The name of the R2 bucket to scope the credentials to.

ParentAccessKeyId string

The parent access key ID to derive the temporary credentials from.

Permission TempCredentialPermission

The permission level for the temporary credentials.

TtlSeconds int

The time-to-live for the credentials in seconds.

Objects IReadOnlyList<string>

Optional list of specific object keys to scope access to. If not specified, credentials have access to all objects matching the bucket/prefix scope.

Prefixes IReadOnlyList<string>

Optional list of object key prefixes to scope access to. If not specified, credentials have access to all objects in the bucket.

Properties

Bucket

The name of the R2 bucket to scope the credentials to.

[JsonPropertyName("bucket")]
public string Bucket { get; init; }

Property Value

string

Objects

Optional list of specific object keys to scope access to. If not specified, credentials have access to all objects matching the bucket/prefix scope.

[JsonPropertyName("objects")]
public IReadOnlyList<string>? Objects { get; init; }

Property Value

IReadOnlyList<string>

ParentAccessKeyId

The parent access key ID to derive the temporary credentials from.

[JsonPropertyName("parentAccessKeyId")]
public string ParentAccessKeyId { get; init; }

Property Value

string

Permission

The permission level for the temporary credentials.

[JsonPropertyName("permission")]
public TempCredentialPermission Permission { get; init; }

Property Value

TempCredentialPermission

Prefixes

Optional list of object key prefixes to scope access to. If not specified, credentials have access to all objects in the bucket.

[JsonPropertyName("prefixes")]
public IReadOnlyList<string>? Prefixes { get; init; }

Property Value

IReadOnlyList<string>

TtlSeconds

The time-to-live for the credentials in seconds.

[JsonPropertyName("ttlSeconds")]
public int TtlSeconds { get; init; }

Property Value

int