Skip to content

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

Provides an interface to call the Application Registration API.

  • Namespace: TrimbleCloud.Tam
  • Assembly: TrimbleCloud.Tam.dll
public interface IApplicationApi

This interface will be injected through AddAccessManagement.

Registers an application with Trimble Access Management.

Task<ApplicationRegisterResponse?> Register(List<string> namespaces, CancellationToken cancellationToken);

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.

Task

The task object representing the asynchronous operation.

AccessManagementException The decision wasn’t able to be evaluated due to failure status code returned from the Server API.

This operation will not block. The returned Task object will complete after the registration is complete.

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);

Registers an application with Trimble Access Management with autoupdate set to true.

Task<ApplicationRegisterResponse?> Register(List<string> namespaces, bool autoupdate, CancellationToken cancellationToken);

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.

Task

The task object representing the asynchronous operation.

AccessManagementException The decision wasn’t able to be evaluated due to failure status code returned from the Server API.

This operation will not block. The returned Task object will complete after the registration is complete.

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);

Updates an application resgistered with Trimble Access Management.

Task<ApplicationRegisterResponse?> Update(List<string> namespaces, string action, CancellationToken cancellationToken);

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.

Task

An object containing all of the current application’s related namespaces (Namespaces) and the date of application’s last bundle update (BundleLastUpdated).

AccessManagementException The decision wasn’t able to be evaluated due to failure status code returned from the Server API.

This operation will not block. The returned Task object will complete after the registration is complete.

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);

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);

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.

Task

An object containing all of the current application’s related namespaces (Namespaces) and the date of application’s last bundle update (BundleLastUpdated).

AccessManagementException The decision wasn’t able to be evaluated due to failure status code returned from the Server API.

This operation will not block. The returned Task object will complete after the registration is complete.

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);

cancellationToken CancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Task

An object containing all of the current application’s related namespaces (Namespaces) and the date of application’s last bundle update (BundleLastUpdated).

AccessManagementException The decision wasn’t able to be evaluated due to failure status code returned from the Server API.

Will return an object with null values if current application has never been registered, has no namespaces, or has no bundle.

var sc = new ServiceCollection();
serviceCollection.AddAccessManagement(environment, consumerKey, consumerSecret, applianceUrl);
var serviceProvider = serviceCollection.BuildServiceProvider();
var applicationApi = serviceProvider.GetRequiredService<IApplicationApi>();
await applicationApi.Get(CancellationToken.None);