Sha256: a0b6a0eac6a4e6ca632e12369de1fd09c099f77e03980d2908fa194a4c8301a8
Contents?: true
Size: 1.51 KB
Versions: 3
Compression:
Stored size: 1.51 KB
Contents
# frozen_string_literal: true module Monday module Resources # Represents Monday.com's workspace resource. module Workspace DEFAULT_SELECT = %w[id name description].freeze # Retrieves all the workspaces. # # Allows filtering workspaces using the args option. # Allows customizing the values to retrieve using the select option. # By default, ID, name and description fields are retrieved. def workspaces(args: {}, select: DEFAULT_SELECT) query = "query { workspaces(#{Util.format_args(args)}) {#{Util.format_select(select)}}}" make_request(query) end # Creates a new workspaces. # # Allows customizing creating a workspace using the args option. # Allows customizing the values to retrieve using the select option. # By default, ID, name and description fields are retrieved. def create_workspace(args: {}, select: DEFAULT_SELECT) query = "mutation { create_workspace(#{Util.format_args(args)}) {#{Util.format_select(select)}}}" make_request(query) end # Deletes a workspace. # # Requires workspace_id to delete the workspace. # Allows customizing the values to retrieve using the select option. # By default, returns the ID of the workspace deleted. def delete_workspace(workspace_id, select: ["id"]) query = "mutation { delete_workspace(workspace_id: #{workspace_id}) {#{Util.format_select(select)}}}" make_request(query) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
monday_ruby-0.6.1 | lib/monday/resources/workspace.rb |
monday_ruby-0.6.0 | lib/monday/resources/workspace.rb |
monday_ruby-0.4.0 | lib/monday/resources/workspace.rb |