// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; import * as BusinessPartnersAPI from './business-partners'; import { APIPromise } from '../core/api-promise'; import { PageCursorURL, PagePromise } from '../core/pagination'; import { buildHeaders } from '../internal/headers'; import { RequestOptions } from '../internal/request-options'; import { path } from '../internal/utils/path'; /** * Software deployed to company devices */ export class SoftwareDeployments extends APIResource { /** * A list of software deployments. * * - Requires: `API Tier 1` * - Filterable fields: `software_id`, `active_group_type` * - Expandable fields: `software` * - Sortable fields: `id`, `created_at`, `updated_at` * * @example HTTP * Representative request and response shapes. * ``` * GET /software-deployments/?filter=filter&expand=expand&order_by=order_by&limit=50&cursor=cursor HTTP/1.1 * Host: rest.ripplingapis.com * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "__meta": { * "redacted_fields": [ * { * "name": "date_of_birth", * "reason": "Insufficient entitlements" * } * ] * }, * "results": [ * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "software_id": "string", * "software": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "display_name": "string", * "icon_url": "string", * "description": "string", * "category": "string", * "scope": "string", * "available_platforms": [] * }, * "ma_device_group_id": "string", * "group_id": "string", * "active_group_type": "Role", * "is_report_syncing_in_progress": false * } * ], * "next_link": "string" * } * ``` */ list( query: SoftwareDeploymentListParams | null | undefined = {}, options?: RequestOptions, ): PagePromise { return this._client.getAPIList('/software-deployments/', PageCursorURL, { query, ...options, }); } /** * Create a new software deployment * * @example HTTP * Representative request and response shapes. * ``` * POST /software-deployments/ HTTP/1.1 * Host: rest.ripplingapis.com * Content-Type: application/json * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * { * "software_id": "software_id" * } * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "software_id": "string", * "software": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "display_name": "string", * "icon_url": "string", * "description": "string", * "category": "string", * "scope": "string", * "available_platforms": [ * "string" * ] * }, * "ma_device_group_id": "string", * "group_id": "string", * "active_group_type": "Role", * "is_report_syncing_in_progress": false * } * ``` */ create( body: SoftwareDeploymentCreateParams, options?: RequestOptions, ): APIPromise { return this._client.post('/software-deployments/', { body, ...options }); } /** * Retrieve a specific software deployment * * @example HTTP * Representative request and response shapes. * ``` * GET /software-deployments/{id}/?expand=expand HTTP/1.1 * Host: rest.ripplingapis.com * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "__meta": { * "redacted_fields": [ * {} * ] * } * } * ``` */ retrieve( id: string, query: SoftwareDeploymentRetrieveParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.get(path`/software-deployments/${id}/`, { query, ...options }); } /** * Update a specific software deployment. * * @example HTTP * Representative request and response shapes. * ``` * PATCH /software-deployments/{id}/ HTTP/1.1 * Host: rest.ripplingapis.com * Content-Type: application/json * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * {} * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "software_id": "string", * "software": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "display_name": "string", * "icon_url": "string", * "description": "string", * "category": "string", * "scope": "string", * "available_platforms": [ * "string" * ] * }, * "ma_device_group_id": "string", * "group_id": "string", * "active_group_type": "Role", * "is_report_syncing_in_progress": false * } * ``` */ update( id: string, body: SoftwareDeploymentUpdateParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.patch(path`/software-deployments/${id}/`, { body, ...options }); } /** * Delete a software deployment * * @example HTTP * Representative request and response shapes. * ``` * DELETE /software-deployments/{id}/ HTTP/1.1 * Host: rest.ripplingapis.com * Rippling-Api-Version: 2024-08-01 * * HTTP/1.1 204 No Content * ``` */ delete(id: string, options?: RequestOptions): APIPromise { return this._client.delete(path`/software-deployments/${id}/`, { ...options, headers: buildHeaders([{ Accept: '*/*' }, options?.headers]), }); } } export type SoftwareDeploymentListResponsesPageCursorURL = PageCursorURL; export interface SoftwareDeploymentListResponse { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * The ID of the software to deploy. */ software_id: string; /** * Record update date */ updated_at: string; /** * Type of group targeting: 'Role' or 'Device'. */ active_group_type?: 'Role' | 'Device'; /** * Group ID for role-based targeting. Required if active_group_type is 'Role'. Must * be null if 'Device'. */ group_id?: string; /** * Whether installation report syncing is in progress. When true, deployment status * may be temporarily inconsistent. */ is_report_syncing_in_progress?: boolean; /** * Device group ID for device-based targeting. Required if active_group_type is * 'Device'. Must be null if 'Role'. */ ma_device_group_id?: string; /** * The software being deployed. Expandable to get software name, icon, and * metadata. * * Expandable field */ software?: SoftwareDeploymentListResponse.Software; } export namespace SoftwareDeploymentListResponse { /** * The software being deployed. Expandable to get software name, icon, and * metadata. * * Expandable field */ export interface Software { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * Platforms this software is available on (macOS, Windows, etc). */ available_platforms?: Array; /** * Category of the software. */ category?: string; /** * Description of the software. */ description?: string; /** * Custom display name for the software. */ display_name?: string; /** * URL for the software icon. */ icon_url?: string; /** * The name of the software. */ name?: string; /** * Scope of the software (PUBLIC, CUSTOM, INTERNAL). */ scope?: string; } } export interface SoftwareDeploymentCreateResponse { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * The ID of the software to deploy. */ software_id: string; /** * Record update date */ updated_at: string; /** * Type of group targeting: 'Role' or 'Device'. */ active_group_type?: 'Role' | 'Device'; /** * Group ID for role-based targeting. Required if active_group_type is 'Role'. Must * be null if 'Device'. */ group_id?: string; /** * Whether installation report syncing is in progress. When true, deployment status * may be temporarily inconsistent. */ is_report_syncing_in_progress?: boolean; /** * Device group ID for device-based targeting. Required if active_group_type is * 'Device'. Must be null if 'Role'. */ ma_device_group_id?: string; /** * The software being deployed. Expandable to get software name, icon, and * metadata. * * Expandable field */ software?: SoftwareDeploymentCreateResponse.Software; } export namespace SoftwareDeploymentCreateResponse { /** * The software being deployed. Expandable to get software name, icon, and * metadata. * * Expandable field */ export interface Software { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * Platforms this software is available on (macOS, Windows, etc). */ available_platforms?: Array; /** * Category of the software. */ category?: string; /** * Description of the software. */ description?: string; /** * Custom display name for the software. */ display_name?: string; /** * URL for the software icon. */ icon_url?: string; /** * The name of the software. */ name?: string; /** * Scope of the software (PUBLIC, CUSTOM, INTERNAL). */ scope?: string; } } /** * Meta information for the response. */ export interface SoftwareDeploymentRetrieveResponse extends BusinessPartnersAPI.Meta { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * The ID of the software to deploy. */ software_id: string; /** * Record update date */ updated_at: string; /** * Type of group targeting: 'Role' or 'Device'. */ active_group_type?: 'Role' | 'Device'; /** * Group ID for role-based targeting. Required if active_group_type is 'Role'. Must * be null if 'Device'. */ group_id?: string; /** * Whether installation report syncing is in progress. When true, deployment status * may be temporarily inconsistent. */ is_report_syncing_in_progress?: boolean; /** * Device group ID for device-based targeting. Required if active_group_type is * 'Device'. Must be null if 'Role'. */ ma_device_group_id?: string; /** * The software being deployed. Expandable to get software name, icon, and * metadata. * * Expandable field */ software?: SoftwareDeploymentRetrieveResponse.Software; } export namespace SoftwareDeploymentRetrieveResponse { /** * The software being deployed. Expandable to get software name, icon, and * metadata. * * Expandable field */ export interface Software { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * Platforms this software is available on (macOS, Windows, etc). */ available_platforms?: Array; /** * Category of the software. */ category?: string; /** * Description of the software. */ description?: string; /** * Custom display name for the software. */ display_name?: string; /** * URL for the software icon. */ icon_url?: string; /** * The name of the software. */ name?: string; /** * Scope of the software (PUBLIC, CUSTOM, INTERNAL). */ scope?: string; } } export interface SoftwareDeploymentUpdateResponse { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * The ID of the software to deploy. */ software_id: string; /** * Record update date */ updated_at: string; /** * Type of group targeting: 'Role' or 'Device'. */ active_group_type?: 'Role' | 'Device'; /** * Group ID for role-based targeting. Required if active_group_type is 'Role'. Must * be null if 'Device'. */ group_id?: string; /** * Whether installation report syncing is in progress. When true, deployment status * may be temporarily inconsistent. */ is_report_syncing_in_progress?: boolean; /** * Device group ID for device-based targeting. Required if active_group_type is * 'Device'. Must be null if 'Role'. */ ma_device_group_id?: string; /** * The software being deployed. Expandable to get software name, icon, and * metadata. * * Expandable field */ software?: SoftwareDeploymentUpdateResponse.Software; } export namespace SoftwareDeploymentUpdateResponse { /** * The software being deployed. Expandable to get software name, icon, and * metadata. * * Expandable field */ export interface Software { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * Platforms this software is available on (macOS, Windows, etc). */ available_platforms?: Array; /** * Category of the software. */ category?: string; /** * Description of the software. */ description?: string; /** * Custom display name for the software. */ display_name?: string; /** * URL for the software icon. */ icon_url?: string; /** * The name of the software. */ name?: string; /** * Scope of the software (PUBLIC, CUSTOM, INTERNAL). */ scope?: string; } } export interface SoftwareDeploymentListParams { cursor?: string; expand?: string; filter?: string; /** * The maximum number of results to return. Defaults to 50. Maximum is 100. */ limit?: number; order_by?: string; } export interface SoftwareDeploymentCreateParams { /** * The ID of the software to deploy. */ software_id: string; /** * Type of group targeting: 'Role' or 'Device'. */ active_group_type?: 'Role' | 'Device'; /** * Group ID for role-based targeting. Required if active_group_type is 'Role'. Must * be null if 'Device'. */ group_id?: string; /** * Device group ID for device-based targeting. Required if active_group_type is * 'Device'. Must be null if 'Role'. */ ma_device_group_id?: string; } export interface SoftwareDeploymentRetrieveParams { expand?: string; } export interface SoftwareDeploymentUpdateParams { /** * Type of group targeting: 'Role' or 'Device'. */ active_group_type?: 'Role' | 'Device'; /** * Group ID for role-based targeting. Required if active_group_type is 'Role'. Must * be null if 'Device'. */ group_id?: string; /** * Device group ID for device-based targeting. Required if active_group_type is * 'Device'. Must be null if 'Role'. */ ma_device_group_id?: string; /** * The ID of the software to deploy. */ software_id?: string; } export declare namespace SoftwareDeployments { export { type SoftwareDeploymentListResponse as SoftwareDeploymentListResponse, type SoftwareDeploymentCreateResponse as SoftwareDeploymentCreateResponse, type SoftwareDeploymentRetrieveResponse as SoftwareDeploymentRetrieveResponse, type SoftwareDeploymentUpdateResponse as SoftwareDeploymentUpdateResponse, type SoftwareDeploymentListResponsesPageCursorURL as SoftwareDeploymentListResponsesPageCursorURL, type SoftwareDeploymentListParams as SoftwareDeploymentListParams, type SoftwareDeploymentCreateParams as SoftwareDeploymentCreateParams, type SoftwareDeploymentRetrieveParams as SoftwareDeploymentRetrieveParams, type SoftwareDeploymentUpdateParams as SoftwareDeploymentUpdateParams, }; }