Class StructurizrClient
A client for the Structurizr API (https://api.structurizr.com) that allows you to get and put Structurizr workspaces in a JSON format.
public class StructurizrClient
- Inheritance
-
StructurizrClient
- Inherited Members
Constructors
StructurizrClient(string, string)
Creates a new Structurizr API client with the specified API key and secret, for the default API URL(https://api.structurizr.com).
public StructurizrClient(string apiKey, string apiSecret)
Parameters
StructurizrClient(string, string, string)
Creates a new Structurizr client with the specified API URL, key and secret.
public StructurizrClient(string apiUrl, string apiKey, string apiSecret)
Parameters
apiUrlstringThe URL of your Structurizr instance.
apiKeystringThe API key of your workspace.
apiSecretstringThe API secret of your workspace.
Fields
IdGenerator
The ID generator to use when parsing a JSON workspace definition.
public IdGenerator IdGenerator
Field Value
Properties
ApiKey
Supplies the workspace API key used for authenticated requests.
public string ApiKey { get; set; }
Property Value
Exceptions
- ArgumentException
Thrown when the assigned value is null, empty, or whitespace.
ApiSecret
Supplies the workspace API secret used for request signing.
public string ApiSecret { get; set; }
Property Value
Exceptions
- ArgumentException
Thrown when the assigned value is null, empty, or whitespace.
EncryptionStrategy
Encrypts outgoing workspaces and decrypts incoming ones when client-side encryption is enabled.
public EncryptionStrategy EncryptionStrategy { get; set; }
Property Value
MergeFromRemote
Controls whether remote layout and view configuration should be merged before uploads.
public bool MergeFromRemote { get; set; }
Property Value
Url
Specifies the base URL of the Structurizr API instance to communicate with.
public string Url { get; set; }
Property Value
Exceptions
- ArgumentException
Thrown when the assigned value is null, empty, or whitespace.
WorkspaceArchiveLocation
the location where a copy of the workspace will be archived when it is retrieved from the server
public DirectoryInfo WorkspaceArchiveLocation { get; set; }
Property Value
Methods
GetWorkspace(long)
Gets the workspace with the given ID.
public Workspace GetWorkspace(long workspaceId)
Parameters
workspaceIdlongThe workspace ID.
Returns
- Workspace
A Workspace object.
LockWorkspace(long)
Locks the specified workspace.
public bool LockWorkspace(long workspaceId)
Parameters
workspaceIdlongThe workspace ID.
Returns
- bool
true if the workspace could be locked, false otherwise.
PutWorkspace(long, Workspace)
Updates the given workspace.
public void PutWorkspace(long workspaceId, Workspace workspace)
Parameters
UnlockWorkspace(long)
Unlocks the specified workspace.
public bool UnlockWorkspace(long workspaceId)
Parameters
workspaceIdlongThe workspace ID.
Returns
- bool
true if the workspace could be unlocked, false otherwise.
createHttpClient()
Creates the HttpClient instance used for API calls.
protected virtual HttpClient createHttpClient()
Returns
- HttpClient
A new HTTP client.