Documentation

UpdateDeveloperKeyDTO extends AbstractBaseDto
in package
implements DTOInterface

DTO for updating Canvas Developer Keys

Handles Canvas API key update parameters following the Canvas API specification. All parameters are nested under the 'developer_key' wrapper in the API request. All properties are optional to allow partial updates.

Tags
see
https://canvas.instructure.com/doc/api/developer_keys.html#method.developer_keys.update

Table of Contents

Interfaces

DTOInterface

Properties

$allowIncludes  : bool|null
$autoExpireTokens  : bool|null
$clientCredentialsAudience  : string|null
$email  : string|null
$iconUrl  : string|null
$name  : string|null
$notes  : string|null
$redirectUri  : string|null
$redirectUris  : array<string|int, string>|null
$requireScopes  : bool|null
$scopes  : array<string|int, string>|null
$testClusterOnly  : bool|null
$vendorCode  : string|null
$visible  : bool|null
$apiPropertyName  : string
The name of the property in the API

Methods

__construct()  : mixed
BaseDto constructor.
addRedirectUri()  : self
Add a single redirect URI to existing list
addScope()  : self
Add a single scope to existing list
clearField()  : self
Clear a specific field (set to null)
fromArray()  : self
Create DTO instance from array data
getUpdatedFields()  : array<string|int, string>
Get array of fields that are set for update
hasUpdates()  : bool
Check if any fields are set for update
removeRedirectUri()  : self
Remove a redirect URI from existing list
removeScope()  : self
Remove a scope from existing list
setAllowIncludes()  : self
Set whether includes are allowed
setAutoExpireTokens()  : self
Set auto-expire tokens setting
setClientCredentialsAudience()  : self
Set client credentials audience
setEmail()  : self
Set the contact email
setIconUrl()  : self
Set the icon URL
setName()  : self
Set the developer key name
setNotes()  : self
Set user notes about the key
setRedirectUris()  : self
Set redirect URIs for OAuth2 flow
setRequireScopes()  : self
Set whether scopes are required
setScopes()  : self
Set API scopes
setTestClusterOnly()  : self
Set test cluster restriction
setVendorCode()  : self
Set the vendor code
setVisible()  : self
Set key visibility
toApiArray()  : array<string, mixed>
Convert to API array format for Canvas requests Only includes non-null values to allow partial updates
toArray()  : array<string|int, mixed>
Convert the DTO to an array
toMultipartArray()  : array<string|int, array<string, mixed>>
Convert to multipart array format for HTTP requests

Properties

$apiPropertyName

The name of the property in the API

protected string $apiPropertyName = 'developer_key'

Methods

__construct()

BaseDto constructor.

public __construct(array<string|int, mixed> $data) : mixed
Parameters
$data : array<string|int, mixed>
Tags
throws
Exception

addRedirectUri()

Add a single redirect URI to existing list

public addRedirectUri(string $uri) : self
Parameters
$uri : string

Redirect URI to add

Return values
self

addScope()

Add a single scope to existing list

public addScope(string $scope) : self
Parameters
$scope : string

API scope to add

Return values
self

clearField()

Clear a specific field (set to null)

public clearField(string $field) : self
Parameters
$field : string

The field name to clear

Return values
self

fromArray()

Create DTO instance from array data

public static fromArray(array<string, mixed> $data) : self
Parameters
$data : array<string, mixed>

Input data

Return values
self

getUpdatedFields()

Get array of fields that are set for update

public getUpdatedFields() : array<string|int, string>
Return values
array<string|int, string>

List of property names that have non-null values

hasUpdates()

Check if any fields are set for update

public hasUpdates() : bool
Return values
bool

True if at least one field has been set

removeRedirectUri()

Remove a redirect URI from existing list

public removeRedirectUri(string $uri) : self
Parameters
$uri : string

Redirect URI to remove

Return values
self

removeScope()

Remove a scope from existing list

public removeScope(string $scope) : self
Parameters
$scope : string

API scope to remove

Return values
self

setAllowIncludes()

Set whether includes are allowed

public setAllowIncludes(bool|null $allowIncludes) : self
Parameters
$allowIncludes : bool|null

If true, allows 'includes' parameters in API requests

Return values
self

setAutoExpireTokens()

Set auto-expire tokens setting

public setAutoExpireTokens(bool|null $autoExpireTokens) : self
Parameters
$autoExpireTokens : bool|null

If true, tokens expire after 1 hour

Return values
self

setClientCredentialsAudience()

Set client credentials audience

public setClientCredentialsAudience(string|null $audience) : self
Parameters
$audience : string|null

Audience for OAuth2 client credentials flow

Return values
self

setEmail()

Set the contact email

public setEmail(string|null $email) : self
Parameters
$email : string|null

Contact email for the key

Return values
self

setIconUrl()

Set the icon URL

public setIconUrl(string|null $iconUrl) : self
Parameters
$iconUrl : string|null

URL for a small icon to display in key list

Return values
self

setName()

Set the developer key name

public setName(string|null $name) : self
Parameters
$name : string|null

The display name for the developer key

Return values
self

setNotes()

Set user notes about the key

public setNotes(string|null $notes) : self
Parameters
$notes : string|null

User-provided notes about the key

Return values
self

setRedirectUris()

Set redirect URIs for OAuth2 flow

public setRedirectUris(array<string|int, string>|null $redirectUris) : self
Parameters
$redirectUris : array<string|int, string>|null

List of URLs used during OAuth2 flow

Return values
self

setRequireScopes()

Set whether scopes are required

public setRequireScopes(bool|null $requireScopes) : self
Parameters
$requireScopes : bool|null

If true, token requests must include scopes

Return values
self

setScopes()

Set API scopes

public setScopes(array<string|int, string>|null $scopes) : self
Parameters
$scopes : array<string|int, string>|null

List of API endpoints key is allowed to access

Return values
self

setTestClusterOnly()

Set test cluster restriction

public setTestClusterOnly(bool|null $testClusterOnly) : self
Parameters
$testClusterOnly : bool|null

If true, key only works in test/beta environments

Return values
self

setVendorCode()

Set the vendor code

public setVendorCode(string|null $vendorCode) : self
Parameters
$vendorCode : string|null

User-specified code representing the vendor

Return values
self

setVisible()

Set key visibility

public setVisible(bool|null $visible) : self
Parameters
$visible : bool|null

If false, key will not be visible in the UI

Return values
self

toApiArray()

Convert to API array format for Canvas requests Only includes non-null values to allow partial updates

public toApiArray() : array<string, mixed>
Return values
array<string, mixed>

toArray()

Convert the DTO to an array

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

toMultipartArray()

Convert to multipart array format for HTTP requests

public toMultipartArray() : array<string|int, array<string, mixed>>
Return values
array<string|int, array<string, mixed>>

        
On this page

Search results