IApplicationApi
title: “IApplicationApi” description: “IApplicationApi Interface” lead: "" date: 2023-06-12T13:46:25-06:00 lastmod: 2023-06-12T13:46:25-06:00 draft: false images: [] menu: docs: parent: “dotnet-api” weight: 323 toc: true
Section titled “title: “IApplicationApi” description: “IApplicationApi Interface” lead: "" date: 2023-06-12T13:46:25-06:00 lastmod: 2023-06-12T13:46:25-06:00 draft: false images: [] menu: docs: parent: “dotnet-api” weight: 323 toc: true”Interface Reference
Definition
Section titled “Definition”Provides an interface to call the Application Registration API.
- Namespace: TrimbleCloud.Tam
- Assembly: TrimbleCloud.Tam.dll
public interface IApplicationApiInitialization
Section titled “Initialization”This interface will be injected through AddAccessManagement.
Methods
Section titled “Methods”Register
Section titled “Register”Registers an application with Trimble Access Management.
Task<ApplicationRegisterResponse?> Register(List<string> namespaces, CancellationToken cancellationToken);Parameters
Section titled “Parameters”namespaces List<string>
The namespaces of packages that should be used to create a bundle for the application. Wildcard namespaces are supported, see \Overview\Implementation
cancellationToken CancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
Section titled “Returns”The task object representing the asynchronous operation.
Exceptions
Section titled “Exceptions”AccessManagementException The decision wasn’t able to be evaluated due to failure status code returned from the Server API.
Remarks
Section titled “Remarks”This operation will not block. The returned Task object will complete after the registration is complete.
Example
Section titled “Example”var sc = new ServiceCollection();serviceCollection.AddAccessManagement(environment, consumerKey, consumerSecret, applianceUrl);var serviceProvider = serviceCollection.BuildServiceProvider();var applicationApi = serviceProvider.GetRequiredService<IApplicationApi>();
await applicationApi.Register(new List<string> { "trimble.example.namespace", "trimble.other.namespace" }, CancellationToken.None);Register with autoupdate
Section titled “Register with autoupdate”Registers an application with Trimble Access Management with autoupdate set to true.
Task<ApplicationRegisterResponse?> Register(List<string> namespaces, bool autoupdate, CancellationToken cancellationToken);Parameters
Section titled “Parameters”namespaces List<string>
The namespaces of packages that should be used to create a bundle for the application. Wildcard namespaces are supported, see \Overview\Implementation
autoupdate bool
This boolean setting determines if packages are auto-bundled. When an application has autoupdate set to true, any package registered to it without a specific version will automatically refresh to the latest changes on the appliance. This happens whenever a new revision of that package is registered or its data file is updated. If all packages are registered with a specific version, setting autoupdate to true will not cause any changes.
cancellationToken CancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
Section titled “Returns”The task object representing the asynchronous operation.
Exceptions
Section titled “Exceptions”AccessManagementException The decision wasn’t able to be evaluated due to failure status code returned from the Server API.
Remarks
Section titled “Remarks”This operation will not block. The returned Task object will complete after the registration is complete.
Example
Section titled “Example”var sc = new ServiceCollection();serviceCollection.AddAccessManagement(environment, consumerKey, consumerSecret, applianceUrl);var serviceProvider = serviceCollection.BuildServiceProvider();var applicationApi = serviceProvider.GetRequiredService<IApplicationApi>();
await applicationApi.Register(new List<string> { "trimble.example.namespace", "trimble.other.namespace" }, true, CancellationToken.None);Update
Section titled “Update”Updates an application resgistered with Trimble Access Management.
Task<ApplicationRegisterResponse?> Update(List<string> namespaces, string action, CancellationToken cancellationToken);Parameters
Section titled “Parameters”namespaces List<string>
The namespaces of packages that should be used to create a bundle for the application. Wildcard namespaces are supported, see \Overview\Implementation
action string
To specify the update actions on existing application like add/remove/overwrite
cancellationToken CancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
Section titled “Returns”An object containing all of the current application’s related namespaces (Namespaces) and the date of application’s last bundle update (BundleLastUpdated).
Exceptions
Section titled “Exceptions”AccessManagementException The decision wasn’t able to be evaluated due to failure status code returned from the Server API.
Remarks
Section titled “Remarks”This operation will not block. The returned Task object will complete after the registration is complete.
Example
Section titled “Example”var sc = new ServiceCollection();serviceCollection.AddAccessManagement(environment, consumerKey, consumerSecret, applianceUrl);var serviceProvider = serviceCollection.BuildServiceProvider();var applicationApi = serviceProvider.GetRequiredService<IApplicationApi>();
await applicationApi.Update(new List<string> { "trimble.example.namespace", "trimble.other.namespace" }, add, CancellationToken.None);Update with autoupdate
Section titled “Update with autoupdate”Updates an application resgistered with Trimble Access Management with autoupdate set to true.
Task<ApplicationRegisterResponse?> Update(List<string> namespaces, string action, bool? autoupdate, CancellationToken cancellationToken);Parameters
Section titled “Parameters”namespaces List<string>
The namespaces of packages that should be used to create a bundle for the application. Wildcard namespaces are supported, see \Overview\Implementation
action string
To specify the update actions on existing application like add/remove/overwrite
autoupdate bool
This boolean setting determines if packages are auto-bundled. If the autoupdate value is null, it defaults to false. When an application has autoupdate set to true, any package registered to it without a specific version will automatically refresh to the latest changes on the appliance. This happens whenever a new revision of that package is registered or its data file is updated. If all packages are registered with a specific version, setting autoupdate to true will not cause any changes.
cancellationToken CancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
Section titled “Returns”An object containing all of the current application’s related namespaces (Namespaces) and the date of application’s last bundle update (BundleLastUpdated).
Exceptions
Section titled “Exceptions”AccessManagementException The decision wasn’t able to be evaluated due to failure status code returned from the Server API.
Remarks
Section titled “Remarks”This operation will not block. The returned Task object will complete after the registration is complete.
Example
Section titled “Example”var sc = new ServiceCollection();serviceCollection.AddAccessManagement(environment, consumerKey, consumerSecret, applianceUrl);var serviceProvider = serviceCollection.BuildServiceProvider();var applicationApi = serviceProvider.GetRequiredService<IApplicationApi>();
await applicationApi.Update(new List<string> { "trimble.example.namespace", "trimble.other.namespace" }, add, true, CancellationToken.None);Gets current application’s namespace and the date of application’s last bundle update from Trimble Access Management.
Task<ApplicationGetResponse> Get(CancellationToken cancellationToken);Parameters
Section titled “Parameters”cancellationToken CancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
Section titled “Returns”An object containing all of the current application’s related namespaces (Namespaces) and the date of application’s last bundle update (BundleLastUpdated).
Exceptions
Section titled “Exceptions”AccessManagementException The decision wasn’t able to be evaluated due to failure status code returned from the Server API.
Remarks
Section titled “Remarks”Will return an object with null values if current application has never been registered, has no namespaces, or has no bundle.
Example
Section titled “Example”var sc = new ServiceCollection();serviceCollection.AddAccessManagement(environment, consumerKey, consumerSecret, applianceUrl);var serviceProvider = serviceCollection.BuildServiceProvider();var applicationApi = serviceProvider.GetRequiredService<IApplicationApi>();
await applicationApi.Get(CancellationToken.None);