WidgetServiceClient class
Constructors
| Widget |
|
| Widget |
Methods
| analyze |
Analyze a widget. The only guarantee is that this method will return a string containing the results of the analysis. |
| create |
Create a new widget. The widget ID is not required during creation, as it is automatically set by the server. Providing an ID will result in an error. |
| delete |
Delete a widget by ID. |
| get |
Get a widget by ID. |
| list |
List all widgets in the system. This operation is not paginated, and returns a simple array of widgets. It does not accept any options or parameters. |
| update |
Update the contents of the widget. The widget ID is required in the input, but cannot be changed. All other fields are optional and will be updated within the widget if provided. |
Constructor Details
WidgetServiceClient(string, TokenCredential, WidgetServiceClientOptions)
new WidgetServiceClient(endpoint: string, credential: TokenCredential, options?: WidgetServiceClientOptions)
Parameters
- endpoint
-
string
- credential
- TokenCredential
- options
- WidgetServiceClientOptions
WidgetServiceClient(string, WidgetServiceClientOptions)
new WidgetServiceClient(endpoint: string, options?: WidgetServiceClientOptions)
Parameters
- endpoint
-
string
- options
- WidgetServiceClientOptions
Method Details
analyzeWidget(string, AnalyzeWidgetOptions)
Analyze a widget. The only guarantee is that this method will return a string containing the results of the analysis.
function analyzeWidget(id: string, options?: AnalyzeWidgetOptions): Promise<AnalyzeResult>
Parameters
- id
-
string
- options
- AnalyzeWidgetOptions
Returns
Promise<AnalyzeResult>
createWidget(number, ColorType, CreateWidgetOptions)
Create a new widget.
The widget ID is not required during creation, as it is automatically set by the server. Providing an ID will result in an error.
function createWidget(weight: number, color: ColorType, options?: CreateWidgetOptions): Promise<Widget>
Parameters
- weight
-
number
- color
- ColorType
- options
- CreateWidgetOptions
Returns
Promise<Widget>
deleteWidget(string, DeleteWidgetOptions)
Delete a widget by ID.
function deleteWidget(id: string, options?: DeleteWidgetOptions): Promise<void>
Parameters
- id
-
string
- options
- DeleteWidgetOptions
Returns
Promise<void>
getWidget(string, GetWidgetOptions)
Get a widget by ID.
function getWidget(id: string, options?: GetWidgetOptions): Promise<Widget>
Parameters
- id
-
string
- options
- GetWidgetOptions
Returns
Promise<Widget>
listWidgets(ListWidgetsOptions)
List all widgets in the system. This operation is not paginated, and returns a simple array of widgets.
It does not accept any options or parameters.
function listWidgets(options?: ListWidgetsOptions): Promise<Widget[]>
Parameters
- options
- ListWidgetsOptions
Returns
Promise<Widget[]>
updateWidget(string, UpdateWidgetOptions)
Update the contents of the widget. The widget ID is required in the input, but cannot be changed. All other fields are optional and will be updated within the widget if provided.
function updateWidget(id: string, options?: UpdateWidgetOptions): Promise<Widget>
Parameters
- id
-
string
- options
- UpdateWidgetOptions
Returns
Promise<Widget>