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
Table of Contents
Interfaces
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
$allowIncludes
public
bool|null
$allowIncludes
= null
$autoExpireTokens
public
bool|null
$autoExpireTokens
= null
$clientCredentialsAudience
public
string|null
$clientCredentialsAudience
= null
public
string|null
$email
= null
$iconUrl
public
string|null
$iconUrl
= null
$name
public
string|null
$name
= null
$notes
public
string|null
$notes
= null
$redirectUri
public
string|null
$redirectUri
= null
$redirectUris
public
array<string|int, string>|null
$redirectUris
= null
$requireScopes
public
bool|null
$requireScopes
= null
$scopes
public
array<string|int, string>|null
$scopes
= null
$testClusterOnly
public
bool|null
$testClusterOnly
= null
$vendorCode
public
string|null
$vendorCode
= null
$visible
public
bool|null
$visible
= null
$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
addRedirectUri()
Add a single redirect URI to existing list
public
addRedirectUri(string $uri) : self
Parameters
- $uri : string
-
Redirect URI to add
Return values
selfaddScope()
Add a single scope to existing list
public
addScope(string $scope) : self
Parameters
- $scope : string
-
API scope to add
Return values
selfclearField()
Clear a specific field (set to null)
public
clearField(string $field) : self
Parameters
- $field : string
-
The field name to clear
Return values
selffromArray()
Create DTO instance from array data
public
static fromArray(array<string, mixed> $data) : self
Parameters
- $data : array<string, mixed>
-
Input data
Return values
selfgetUpdatedFields()
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
selfremoveScope()
Remove a scope from existing list
public
removeScope(string $scope) : self
Parameters
- $scope : string
-
API scope to remove
Return values
selfsetAllowIncludes()
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
selfsetAutoExpireTokens()
Set auto-expire tokens setting
public
setAutoExpireTokens(bool|null $autoExpireTokens) : self
Parameters
- $autoExpireTokens : bool|null
-
If true, tokens expire after 1 hour
Return values
selfsetClientCredentialsAudience()
Set client credentials audience
public
setClientCredentialsAudience(string|null $audience) : self
Parameters
- $audience : string|null
-
Audience for OAuth2 client credentials flow
Return values
selfsetEmail()
Set the contact email
public
setEmail(string|null $email) : self
Parameters
- $email : string|null
-
Contact email for the key
Return values
selfsetIconUrl()
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
selfsetName()
Set the developer key name
public
setName(string|null $name) : self
Parameters
- $name : string|null
-
The display name for the developer key
Return values
selfsetNotes()
Set user notes about the key
public
setNotes(string|null $notes) : self
Parameters
- $notes : string|null
-
User-provided notes about the key
Return values
selfsetRedirectUris()
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
selfsetRequireScopes()
Set whether scopes are required
public
setRequireScopes(bool|null $requireScopes) : self
Parameters
- $requireScopes : bool|null
-
If true, token requests must include scopes
Return values
selfsetScopes()
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
selfsetTestClusterOnly()
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
selfsetVendorCode()
Set the vendor code
public
setVendorCode(string|null $vendorCode) : self
Parameters
- $vendorCode : string|null
-
User-specified code representing the vendor
Return values
selfsetVisible()
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
selftoApiArray()
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>>