From 2812539426304333aba60206ec33ec1dd41c968b Mon Sep 17 00:00:00 2001 From: Dean Hicks Date: Thu, 21 Sep 2023 19:26:35 +0000 Subject: [PATCH] feat: generate SDKs for Looker 23.16 Release-As: 23.16.0 --- csharp/rtl/Constants.cs | 2 +- csharp/sdk/4.0/methods.cs | 153 +++-- csharp/sdk/4.0/models.cs | 46 +- go/sdk/v4/methods.go | 118 +++- go/sdk/v4/models.go | 49 +- kotlin/src/main/com/looker/sdk/4.0/methods.kt | 144 ++++- kotlin/src/main/com/looker/sdk/4.0/models.kt | 52 +- kotlin/src/main/com/looker/sdk/4.0/streams.kt | 144 ++++- kotlin/src/main/com/looker/sdk/Constants.kt | 2 +- packages/sdk/src/4.0/funcs.ts | 154 ++++- packages/sdk/src/4.0/methods.ts | 150 ++++- packages/sdk/src/4.0/methodsInterface.ts | 121 +++- packages/sdk/src/4.0/models.ts | 81 ++- packages/sdk/src/4.0/streams.ts | 162 +++++- packages/sdk/src/constants.ts | 2 +- python/looker_sdk/sdk/api40/methods.py | 168 ++++-- python/looker_sdk/sdk/api40/models.py | 82 ++- python/looker_sdk/sdk/constants.py | 2 +- spec/Looker.4.0.json | 382 ++++++++++-- spec/Looker.4.0.oas.json | 550 ++++++++++++++++-- swift/looker/rtl/constants.swift | 2 +- swift/looker/sdk/methods.swift | 153 ++++- swift/looker/sdk/models.swift | 142 ++++- swift/looker/sdk/streams.swift | 151 ++++- 24 files changed, 2552 insertions(+), 460 deletions(-) diff --git a/csharp/rtl/Constants.cs b/csharp/rtl/Constants.cs index 292bb969c..2e8842f39 100644 --- a/csharp/rtl/Constants.cs +++ b/csharp/rtl/Constants.cs @@ -61,7 +61,7 @@ public struct Constants public const string DefaultApiVersion = "4.0"; public const string AgentPrefix = "CS-SDK"; - public const string LookerVersion = "23.14"; + public const string LookerVersion = "23.17"; public const string Bearer = "Bearer"; public const string LookerAppiId = "x-looker-appid"; diff --git a/csharp/sdk/4.0/methods.cs b/csharp/sdk/4.0/methods.cs index db336c348..ad74b9348 100644 --- a/csharp/sdk/4.0/methods.cs +++ b/csharp/sdk/4.0/methods.cs @@ -21,7 +21,7 @@ /// SOFTWARE. /// -/// 461 API methods +/// 464 API methods #nullable enable using System; @@ -738,6 +738,21 @@ public async Task> create_embed_url_as_ return await AuthRequest(HttpMethod.Post, "/embed/token_url/me", null,body,options); } + /// ### Validate a Signed Embed URL + /// + /// GET /embed/sso/validate -> EmbedUrlResponse + /// + /// EmbedUrlResponse Embed URL Validation (application/json) + /// + /// URL to validate + public async Task> validate_embed_url( + string? url = null, + ITransportSettings? options = null) +{ + return await AuthRequest(HttpMethod.Get, "/embed/sso/validate", new Values { + { "url", url }},null,options); + } + /// ### Acquire a cookieless embed session. /// /// The acquire session endpoint negates the need for signing the embed url and passing it as a parameter @@ -1764,10 +1779,10 @@ public async Task> create_board( /// Return favorited boards when true. /// Filter on boards created by a particular user. /// The fields to sort the results by - /// The page to return. DEPRECATED. Use offset instead. - /// The number of items in the returned page. DEPRECATED. Use limit instead. - /// The number of items to skip before returning any. (used with limit and takes priority over page and per_page) - /// The maximum number of items to return. (used with offset and takes priority over page and per_page) + /// DEPRECATED. Use limit and offset instead. Return only page N of paginated results + /// DEPRECATED. Use limit and offset instead. Return N rows of data per page + /// Number of results to return. (used with offset and takes priority over page and per_page) + /// Number of results to skip before returning any. (used with limit and takes priority over page and per_page) /// Combine given search criteria in a boolean OR expression /// Filter results based on permission, either show (default) or update public async Task> search_boards( @@ -2621,11 +2636,14 @@ public async Task> api_spec( } /// ### This feature is enabled only by special license. - /// ### Gets the whitelabel configuration, which includes hiding documentation links, custom favicon uploading, etc. + /// + /// This endpoint provides the private label configuration, which includes hiding documentation links, custom favicon uploading, etc. + /// + /// This endpoint is deprecated. [Get Setting](#!/Config/get_setting) should be used to retrieve private label settings instead /// /// GET /whitelabel_configuration -> WhitelabelConfiguration /// - /// WhitelabelConfiguration Whitelabel configuration (application/json) + /// WhitelabelConfiguration Private label configuration (application/json) /// /// Requested fields. [Obsolete("Deprecated")] @@ -2637,11 +2655,13 @@ public async Task> whitelabel_co { "fields", fields }},null,options); } - /// ### Update the whitelabel configuration + /// ### Update the private label configuration + /// + /// This endpoint is deprecated. [Set Setting](#!/Config/set_setting) should be used to update private label settings instead /// /// PUT /whitelabel_configuration -> WhitelabelConfiguration /// - /// WhitelabelConfiguration Whitelabel configuration (application/json) + /// WhitelabelConfiguration Private label configuration (application/json) /// [Obsolete("Deprecated")] public async Task> update_whitelabel_configuration( @@ -3298,15 +3318,15 @@ public async Task> delete_content_metadata_access /// /// GET /content/{terms} -> ContentSearch[] /// - /// ContentSearch[] content (application/json) + /// ContentSearch[] Matching content (application/json) /// /// Search terms /// Requested fields. /// Content types requested (dashboard, look, lookml_dashboard). /// Number of results to return. (used with offset and takes priority over page and per_page) /// Number of results to skip before returning any. (used with limit and takes priority over page and per_page) - /// Requested page. - /// Results per page. + /// DEPRECATED. Use limit and offset instead. Return only page N of paginated results + /// DEPRECATED. Use limit and offset instead. Return N rows of data per page public async Task> search_content( string terms, string? fields = null, @@ -3576,7 +3596,7 @@ public async Task> create_dashboard( /// Match Dashboard title. /// Match Dashboard description. /// Filter on a content favorite id. - /// Filter on a particular space. + /// Filter on a particular folder. /// Filter on dashboards deleted status. /// Filter on dashboards created by a particular user. /// Filter on a particular value of view_count @@ -4555,10 +4575,7 @@ public async Task> delete_folder( /// ### Get information about all folders. /// - /// In API 3.x, this will not return empty personal folders, unless they belong to the calling user, - /// or if they contain soft-deleted content. - /// - /// In API 4.0+, all personal folders will be returned. + /// All personal folders will be returned. /// /// GET /folders -> Folder[] /// @@ -4683,7 +4700,6 @@ public async Task> folder_ancestors( } /// ### Get all looks in a folder. - /// In API 3.x, this will return all looks in a folder, including looks in the trash. /// In API 4.0+, all looks in a folder will be returned, excluding looks in the trash. /// /// GET /folders/{folder_id}/looks -> LookWithQuery[] @@ -5590,7 +5606,7 @@ public async Task> look( /// /// Soft-deleted looks are excluded from the results of [all_looks()](#!/Look/all_looks) and [search_looks()](#!/Look/search_looks), so they /// essentially disappear from view even though they still reside in the db. - /// In API 3.1 and later, you can pass `deleted: true` as a parameter to [search_looks()](#!/3.1/Look/search_looks) to list soft-deleted looks. + /// You can pass `deleted: true` as a parameter to [search_looks()](#!/Look/search_looks) to list soft-deleted looks. /// /// NOTE: [delete_look()](#!/Look/delete_look) performs a "hard delete" - the look data is removed from the Looker /// database and destroyed. There is no "undo" for `delete_look()`. @@ -5642,7 +5658,8 @@ public async Task> delete_look( /// | result_format | Description /// | :-----------: | :--- | /// | json | Plain json - /// | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + /// | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + /// | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query /// | csv | Comma separated values with a header /// | txt | Tab separated values with a header /// | html | Simple html @@ -7091,7 +7108,8 @@ public async Task> create_query( /// | result_format | Description /// | :-----------: | :--- | /// | json | Plain json - /// | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + /// | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + /// | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query /// | csv | Comma separated values with a header /// | txt | Tab separated values with a header /// | html | Simple html @@ -7204,7 +7222,8 @@ public async Task> run_query( /// | result_format | Description /// | :-----------: | :--- | /// | json | Plain json - /// | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + /// | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + /// | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query /// | csv | Comma separated values with a header /// | txt | Tab separated values with a header /// | html | Simple html @@ -7288,7 +7307,7 @@ public async Task> run_inline_query( /// Here is an example inline query URL: /// /// ``` - /// https://looker.mycompany.com:19999/api/3.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles + /// https://looker.mycompany.com:19999/api/4.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles /// ``` /// /// When invoking this endpoint with the Ruby SDK, pass the query parameter parts as a hash. The hash to match the above would look like: @@ -7314,7 +7333,8 @@ public async Task> run_inline_query( /// | result_format | Description /// | :-----------: | :--- | /// | json | Plain json - /// | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + /// | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + /// | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query /// | csv | Comma separated values with a header /// | txt | Tab separated values with a header /// | html | Simple html @@ -7429,19 +7449,68 @@ public async Task> kill_query( return await AuthRequest(HttpMethod.Delete, $"/running_queries/{query_task_id}", null,null,options); } - /// Get a SQL Runner query. + /// ### Run a saved SQL interface query. /// - /// GET /sql_queries/{slug} -> SqlQuery + /// This runs a previously created SQL interface query. /// - /// SqlQuery SQL Runner Query (application/json) + /// The 'result_format' parameter specifies the desired structure and format of the response. /// - /// slug of query - public async Task> sql_query( - string slug, + /// Supported formats: + /// + /// | result_format | Description + /// | :-----------: | :--- | + /// | json | Plain json + /// | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + /// | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + /// | csv | Comma separated values with a header + /// | txt | Tab separated values with a header + /// | html | Simple html + /// | md | Simple markdown + /// | xlsx | MS Excel spreadsheet + /// | sql | Returns the generated SQL rather than running the query + /// | png | A PNG image of the visualization of the query + /// | jpg | A JPG image of the visualization of the query + /// + /// GET /sql_interface_queries/{query_id}/run/{result_format} -> string + /// + /// **Note**: Binary content may be returned by this method. + /// + /// + /// string SQL Interface Query (text) + /// string SQL Interface Query (application/json) + /// string SQL Interface Query (image/png) + /// string SQL Interface Query (image/jpeg) + /// + /// + /// Integer id of query + /// Format of result, options are: ["json_bi"] + public async Task> run_sql_interface_query( + long query_id, + string result_format, + ITransportSettings? options = null) where TSuccess : class +{ + result_format = SdkUtils.EncodeParam(result_format); + return await AuthRequest(HttpMethod.Get, $"/sql_interface_queries/{query_id}/run/{result_format}", null,null,options); + } + + /// ### Create a SQL interface query. + /// + /// This allows you to create a new SQL interface query that you can later run. Looker queries are immutable once created + /// and are not deleted. If you create a query that is exactly like an existing query then the existing query + /// will be returned and no new query will be created. Whether a new query is created or not, you can use + /// the 'id' in the returned query with the 'run' method. + /// + /// The query parameters are passed as json in the body of the request. + /// + /// POST /sql_interface_queries -> SqlInterfaceQuery + /// + /// SqlInterfaceQuery SQL Interface Query (application/json) + /// + public async Task> create_sql_interface_query( + WriteSqlInterfaceQueryCreate body, ITransportSettings? options = null) { - slug = SdkUtils.EncodeParam(slug); - return await AuthRequest(HttpMethod.Get, $"/sql_queries/{slug}", null,null,options); + return await AuthRequest(HttpMethod.Post, "/sql_interface_queries", null,body,options); } /// ### Create a SQL Runner Query @@ -7459,6 +7528,21 @@ public async Task> create_sql_query( return await AuthRequest(HttpMethod.Post, "/sql_queries", null,body,options); } + /// Get a SQL Runner query. + /// + /// GET /sql_queries/{slug} -> SqlQuery + /// + /// SqlQuery SQL Runner Query (application/json) + /// + /// slug of query + public async Task> sql_query( + string slug, + ITransportSettings? options = null) +{ + slug = SdkUtils.EncodeParam(slug); + return await AuthRequest(HttpMethod.Get, $"/sql_queries/{slug}", null,null,options); + } + /// Execute a SQL Runner query in a given result_format. /// /// POST /sql_queries/{slug}/run/{result_format} -> string @@ -7571,6 +7655,7 @@ public async Task> create_query_render_task( /// Paper size for pdf. Value can be one of: ["letter","legal","tabloid","a0","a1","a2","a3","a4","a5"] /// Whether to render pdf in landscape paper orientation /// Whether or not to expand table vis to full length + /// Theme to apply. Will render embedded version of dashboard if valid public async Task> create_dashboard_render_task( string dashboard_id, string result_format, @@ -7581,6 +7666,7 @@ public async Task> create_dashboard_render_ta string? pdf_paper_size = null, bool? pdf_landscape = null, bool? long_tables = null, + string? theme = null, ITransportSettings? options = null) { dashboard_id = SdkUtils.EncodeParam(dashboard_id); @@ -7591,7 +7677,8 @@ public async Task> create_dashboard_render_ta { "fields", fields }, { "pdf_paper_size", pdf_paper_size }, { "pdf_landscape", pdf_landscape }, - { "long_tables", long_tables }},body,options); + { "long_tables", long_tables }, + { "theme", theme }},body,options); } /// ### Get information about a render task. diff --git a/csharp/sdk/4.0/models.cs b/csharp/sdk/4.0/models.cs index 88ad7525e..be8f99fe3 100644 --- a/csharp/sdk/4.0/models.cs +++ b/csharp/sdk/4.0/models.cs @@ -21,7 +21,7 @@ /// SOFTWARE. /// -/// 329 API models: 247 Spec, 0 Request, 60 Write, 22 Enum +/// 332 API models: 249 Spec, 0 Request, 61 Write, 22 Enum #nullable enable using System; @@ -58,7 +58,7 @@ public class Alert : SdkModel /// This property informs the check what kind of comparison we are performing. Only certain condition types are valid for time series alerts. For details, refer to [Setting Alert Conditions](https://cloud.google.com/looker/docs/sharing-and-publishing/creating-alerts#setting_alert_conditions) Valid values are: "EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL_TO", "LESS_THAN", "LESS_THAN_OR_EQUAL_TO", "INCREASES_BY", "DECREASES_BY", "CHANGES_BY". [JsonConverter(typeof(StringEnumConverter))] public ComparisonType comparison_type { get; set; } - /// Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals + /// Vixie-Style crontab specification when to run. At minimum, it has to be longer than 15 minute intervals public string cron { get; set; } = ""; /// Domain for the custom url selected by the alert creator from the admin defined domain allowlist public string? custom_url_base { get; set; } = null; @@ -1811,7 +1811,7 @@ public class Dialect : SdkModel public string? persistent_table_sortkeys { get; set; } = null; /// PDT distkey column (read-only) public string? persistent_table_distkey { get; set; } = null; - /// Suports streaming results (read-only) + /// Supports streaming results (read-only) public bool? supports_streaming { get; set; } = null; /// Should SQL Runner snippets automatically be run (read-only) public bool? automatically_run_sql_runner_snippets { get; set; } = null; @@ -2565,9 +2565,9 @@ public class IntegrationRequiredField : SdkModel { /// Matches a field that has this tag. (read-only) public string? tag { get; set; } = null; - /// If present, supercedes 'tag' and matches a field that has any of the provided tags. (read-only) + /// If present, supersedes 'tag' and matches a field that has any of the provided tags. (read-only) public string[]? any_tag { get; set; } = null; - /// If present, supercedes 'tag' and matches a field that has all of the provided tags. (read-only) + /// If present, supersedes 'tag' and matches a field that has all of the provided tags. (read-only) public string[]? all_tags { get; set; } = null; } @@ -3970,6 +3970,8 @@ public class Project : SdkModel public bool? is_example { get; set; } = null; /// Status of dependencies in your manifest & lockfile public string? dependency_status { get; set; } = null; + /// Number of data tests within project (read-only) + public long? data_tests_count { get; set; } = null; } public class ProjectError : SdkModel @@ -4858,6 +4860,26 @@ public class Snippet : SdkModel public string? sql { get; set; } = null; } +public class SqlInterfaceQuery : SdkModel +{ + /// Operations the current user is able to perform on this object (read-only) + public StringDictionary? can { get; set; } = null; + /// Unique Id (read-only) + public long? id { get; set; } = null; + /// Calcite signature (read-only) + public string signature { get; set; } = ""; +} + +public class SqlInterfaceQueryCreate : SdkModel +{ + /// Operations the current user is able to perform on this object (read-only) + public StringDictionary? can { get; set; } = null; + /// Original SQL request + public string sql { get; set; } = ""; + /// Whether the query should be run for use in a JDBC Client. This changes the formatting of some datetime based values. + public bool? jdbc_client { get; set; } = null; +} + public class SqlQuery : SdkModel { /// Operations the current user is able to perform on this object (read-only) @@ -5534,7 +5556,7 @@ public class WriteAlert : SdkModel /// This property informs the check what kind of comparison we are performing. Only certain condition types are valid for time series alerts. For details, refer to [Setting Alert Conditions](https://cloud.google.com/looker/docs/sharing-and-publishing/creating-alerts#setting_alert_conditions) Valid values are: "EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL_TO", "LESS_THAN", "LESS_THAN_OR_EQUAL_TO", "INCREASES_BY", "DECREASES_BY", "CHANGES_BY". [JsonConverter(typeof(StringEnumConverter))] public ComparisonType comparison_type { get; set; } - /// Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals + /// Vixie-Style crontab specification when to run. At minimum, it has to be longer than 15 minute intervals public string cron { get; set; } = ""; /// Domain for the custom url selected by the alert creator from the admin defined domain allowlist public string? custom_url_base { get; set; } = null; @@ -6478,7 +6500,7 @@ public class WritePrivatelabelConfiguration : SdkModel } /// Dynamic writeable type for Project removes: -/// can, id, uses_git, is_example +/// can, id, uses_git, is_example, data_tests_count public class WriteProject : SdkModel { /// Project display name @@ -6785,6 +6807,16 @@ public class WriteSetting : SdkModel public EmbedConfig? embed_config { get; set; } } +/// Dynamic writeable type for SqlInterfaceQueryCreate removes: +/// can +public class WriteSqlInterfaceQueryCreate : SdkModel +{ + /// Original SQL request + public string sql { get; set; } = ""; + /// Whether the query should be run for use in a JDBC Client. This changes the formatting of some datetime based values. + public bool? jdbc_client { get; set; } = null; +} + /// Dynamic writeable type for SshServer removes: /// ssh_server_id, finger_print, sha_finger_print, public_key, status public class WriteSshServer : SdkModel diff --git a/go/sdk/v4/methods.go b/go/sdk/v4/methods.go index 8c32c7168..46d6be848 100644 --- a/go/sdk/v4/methods.go +++ b/go/sdk/v4/methods.go @@ -26,7 +26,7 @@ SOFTWARE. /* -461 API methods +464 API methods */ // NOTE: Do not edit this file generated by Looker SDK Codegen for API v4 @@ -607,6 +607,18 @@ func (l *LookerSDK) CreateEmbedUrlAsMe( } +// ### Validate a Signed Embed URL +// +// GET /embed/sso/validate -> EmbedUrlResponse +func (l *LookerSDK) ValidateEmbedUrl( + url string, + options *rtl.ApiSettings) (EmbedUrlResponse, error) { + var result EmbedUrlResponse + err := l.session.Do(&result, "GET", "/4.0", "/embed/sso/validate", map[string]interface{}{"url": url}, nil, options) + return result, err + +} + // ### Acquire a cookieless embed session. // // The acquire session endpoint negates the need for signing the embed url and passing it as a parameter @@ -2216,7 +2228,10 @@ func (l *LookerSDK) ApiSpec( } // ### This feature is enabled only by special license. -// ### Gets the whitelabel configuration, which includes hiding documentation links, custom favicon uploading, etc. +// +// This endpoint provides the private label configuration, which includes hiding documentation links, custom favicon uploading, etc. +// +// This endpoint is deprecated. [Get Setting](#!/Config/get_setting) should be used to retrieve private label settings instead // // GET /whitelabel_configuration -> WhitelabelConfiguration // @@ -2230,7 +2245,9 @@ func (l *LookerSDK) WhitelabelConfiguration( } -// ### Update the whitelabel configuration +// ### Update the private label configuration +// +// This endpoint is deprecated. [Set Setting](#!/Config/set_setting) should be used to update private label settings instead // // PUT /whitelabel_configuration -> WhitelabelConfiguration // @@ -3652,10 +3669,7 @@ func (l *LookerSDK) DeleteFolder( // ### Get information about all folders. // -// In API 3.x, this will not return empty personal folders, unless they belong to the calling user, -// or if they contain soft-deleted content. -// -// In API 4.0+, all personal folders will be returned. +// All personal folders will be returned. // // GET /folders -> []Folder func (l *LookerSDK) AllFolders( @@ -3735,7 +3749,6 @@ func (l *LookerSDK) FolderAncestors( } // ### Get all looks in a folder. -// In API 3.x, this will return all looks in a folder, including looks in the trash. // In API 4.0+, all looks in a folder will be returned, excluding looks in the trash. // // GET /folders/{folder_id}/looks -> []LookWithQuery @@ -4347,7 +4360,7 @@ func (l *LookerSDK) Look( // // Soft-deleted looks are excluded from the results of [all_looks()](#!/Look/all_looks) and [search_looks()](#!/Look/search_looks), so they // essentially disappear from view even though they still reside in the db. -// In API 3.1 and later, you can pass `deleted: true` as a parameter to [search_looks()](#!/3.1/Look/search_looks) to list soft-deleted looks. +// You can pass `deleted: true` as a parameter to [search_looks()](#!/Look/search_looks) to list soft-deleted looks. // // NOTE: [delete_look()](#!/Look/delete_look) performs a "hard delete" - the look data is removed from the Looker // database and destroyed. There is no "undo" for `delete_look()`. @@ -4393,7 +4406,8 @@ func (l *LookerSDK) DeleteLook( // | result_format | Description // | :-----------: | :--- | // | json | Plain json -// | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query +// | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query +// | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query // | csv | Comma separated values with a header // | txt | Tab separated values with a header // | html | Simple html @@ -5465,7 +5479,8 @@ func (l *LookerSDK) CreateQuery( // | result_format | Description // | :-----------: | :--- | // | json | Plain json -// | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query +// | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query +// | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query // | csv | Comma separated values with a header // | txt | Tab separated values with a header // | html | Simple html @@ -5533,7 +5548,8 @@ func (l *LookerSDK) RunQuery(request RequestRunQuery, // | result_format | Description // | :-----------: | :--- | // | json | Plain json -// | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query +// | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query +// | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query // | csv | Comma separated values with a header // | txt | Tab separated values with a header // | html | Simple html @@ -5572,7 +5588,7 @@ func (l *LookerSDK) RunInlineQuery(request RequestRunInlineQuery, // Here is an example inline query URL: // // ``` -// https://looker.mycompany.com:19999/api/3.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles +// https://looker.mycompany.com:19999/api/4.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles // ``` // // When invoking this endpoint with the Ruby SDK, pass the query parameter parts as a hash. The hash to match the above would look like: @@ -5600,7 +5616,8 @@ func (l *LookerSDK) RunInlineQuery(request RequestRunInlineQuery, // | result_format | Description // | :-----------: | :--- | // | json | Plain json -// | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query +// | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query +// | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query // | csv | Comma separated values with a header // | txt | Tab separated values with a header // | html | Simple html @@ -5696,15 +5713,57 @@ func (l *LookerSDK) KillQuery( } -// Get a SQL Runner query. +// ### Run a saved SQL interface query. // -// GET /sql_queries/{slug} -> SqlQuery -func (l *LookerSDK) SqlQuery( - slug string, - options *rtl.ApiSettings) (SqlQuery, error) { - slug = url.PathEscape(slug) - var result SqlQuery - err := l.session.Do(&result, "GET", "/4.0", fmt.Sprintf("/sql_queries/%v", slug), nil, nil, options) +// This runs a previously created SQL interface query. +// +// The 'result_format' parameter specifies the desired structure and format of the response. +// +// Supported formats: +// +// | result_format | Description +// | :-----------: | :--- | +// | json | Plain json +// | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query +// | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query +// | csv | Comma separated values with a header +// | txt | Tab separated values with a header +// | html | Simple html +// | md | Simple markdown +// | xlsx | MS Excel spreadsheet +// | sql | Returns the generated SQL rather than running the query +// | png | A PNG image of the visualization of the query +// | jpg | A JPG image of the visualization of the query +// +// GET /sql_interface_queries/{query_id}/run/{result_format} -> string +// +// **Note**: Binary content may be returned by this method. +func (l *LookerSDK) RunSqlInterfaceQuery( + queryId int64, + resultFormat string, + options *rtl.ApiSettings) (string, error) { + resultFormat = url.PathEscape(resultFormat) + var result string + err := l.session.Do(&result, "GET", "/4.0", fmt.Sprintf("/sql_interface_queries/%v/run/%v", queryId, resultFormat), nil, nil, options) + return result, err + +} + +// ### Create a SQL interface query. +// +// This allows you to create a new SQL interface query that you can later run. Looker queries are immutable once created +// and are not deleted. If you create a query that is exactly like an existing query then the existing query +// will be returned and no new query will be created. Whether a new query is created or not, you can use +// the 'id' in the returned query with the 'run' method. +// +// The query parameters are passed as json in the body of the request. +// +// POST /sql_interface_queries -> SqlInterfaceQuery +func (l *LookerSDK) CreateSqlInterfaceQuery( + body WriteSqlInterfaceQueryCreate, + options *rtl.ApiSettings) (SqlInterfaceQuery, error) { + var result SqlInterfaceQuery + err := l.session.Do(&result, "POST", "/4.0", "/sql_interface_queries", nil, body, options) return result, err } @@ -5723,6 +5782,19 @@ func (l *LookerSDK) CreateSqlQuery( } +// Get a SQL Runner query. +// +// GET /sql_queries/{slug} -> SqlQuery +func (l *LookerSDK) SqlQuery( + slug string, + options *rtl.ApiSettings) (SqlQuery, error) { + slug = url.PathEscape(slug) + var result SqlQuery + err := l.session.Do(&result, "GET", "/4.0", fmt.Sprintf("/sql_queries/%v", slug), nil, nil, options) + return result, err + +} + // Execute a SQL Runner query in a given result_format. // // POST /sql_queries/{slug}/run/{result_format} -> string @@ -5801,7 +5873,7 @@ func (l *LookerSDK) CreateDashboardRenderTask(request RequestCreateDashboardRend request.DashboardId = url.PathEscape(request.DashboardId) request.ResultFormat = url.PathEscape(request.ResultFormat) var result RenderTask - err := l.session.Do(&result, "POST", "/4.0", fmt.Sprintf("/render_tasks/dashboards/%v/%v", request.DashboardId, request.ResultFormat), map[string]interface{}{"width": request.Width, "height": request.Height, "fields": request.Fields, "pdf_paper_size": request.PdfPaperSize, "pdf_landscape": request.PdfLandscape, "long_tables": request.LongTables}, request.Body, options) + err := l.session.Do(&result, "POST", "/4.0", fmt.Sprintf("/render_tasks/dashboards/%v/%v", request.DashboardId, request.ResultFormat), map[string]interface{}{"width": request.Width, "height": request.Height, "fields": request.Fields, "pdf_paper_size": request.PdfPaperSize, "pdf_landscape": request.PdfLandscape, "long_tables": request.LongTables, "theme": request.Theme}, request.Body, options) return result, err } diff --git a/go/sdk/v4/models.go b/go/sdk/v4/models.go index 751e011c5..6678ebc71 100644 --- a/go/sdk/v4/models.go +++ b/go/sdk/v4/models.go @@ -26,7 +26,7 @@ SOFTWARE. /* -394 API models: 247 Spec, 66 Request, 59 Write, 22 Enum +397 API models: 249 Spec, 66 Request, 60 Write, 22 Enum */ // NOTE: Do not edit this file generated by Looker SDK Codegen for API v4 @@ -48,7 +48,7 @@ type AccessToken struct { type Alert struct { AppliedDashboardFilters *[]AlertAppliedDashboardFilter `json:"applied_dashboard_filters,omitempty"` // Filters coming from the dashboard that are applied. Example `[{ "filter_title": "Name", "field_name": "distribution_centers.name", "filter_value": "Los Angeles CA" }]` ComparisonType ComparisonType `json:"comparison_type"` // This property informs the check what kind of comparison we are performing. Only certain condition types are valid for time series alerts. For details, refer to [Setting Alert Conditions](https://cloud.google.com/looker/docs/sharing-and-publishing/creating-alerts#setting_alert_conditions) Valid values are: "EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL_TO", "LESS_THAN", "LESS_THAN_OR_EQUAL_TO", "INCREASES_BY", "DECREASES_BY", "CHANGES_BY". - Cron string `json:"cron"` // Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals + Cron string `json:"cron"` // Vixie-Style crontab specification when to run. At minimum, it has to be longer than 15 minute intervals CustomUrlBase *string `json:"custom_url_base,omitempty"` // Domain for the custom url selected by the alert creator from the admin defined domain allowlist CustomUrlParams *string `json:"custom_url_params,omitempty"` // Parameters and path for the custom url defined by the alert creator CustomUrlLabel *string `json:"custom_url_label,omitempty"` // Label for the custom url defined by the alert creator @@ -1028,7 +1028,7 @@ type Dialect struct { PersistentTableIndexes *string `json:"persistent_table_indexes,omitempty"` // PDT index columns PersistentTableSortkeys *string `json:"persistent_table_sortkeys,omitempty"` // PDT sortkey columns PersistentTableDistkey *string `json:"persistent_table_distkey,omitempty"` // PDT distkey column - SupportsStreaming *bool `json:"supports_streaming,omitempty"` // Suports streaming results + SupportsStreaming *bool `json:"supports_streaming,omitempty"` // Supports streaming results AutomaticallyRunSqlRunnerSnippets *bool `json:"automatically_run_sql_runner_snippets,omitempty"` // Should SQL Runner snippets automatically be run ConnectionTests *[]string `json:"connection_tests,omitempty"` // Array of names of the tests that can be run on a connection using this dialect SupportsInducer *bool `json:"supports_inducer,omitempty"` // Is supported with the inducer (i.e. generate from sql) @@ -1442,8 +1442,8 @@ type IntegrationParam struct { type IntegrationRequiredField struct { Tag *string `json:"tag,omitempty"` // Matches a field that has this tag. - AnyTag *[]string `json:"any_tag,omitempty"` // If present, supercedes 'tag' and matches a field that has any of the provided tags. - AllTags *[]string `json:"all_tags,omitempty"` // If present, supercedes 'tag' and matches a field that has all of the provided tags. + AnyTag *[]string `json:"any_tag,omitempty"` // If present, supersedes 'tag' and matches a field that has any of the provided tags. + AllTags *[]string `json:"all_tags,omitempty"` // If present, supersedes 'tag' and matches a field that has all of the provided tags. } type IntegrationTestResult struct { @@ -2215,6 +2215,7 @@ type Project struct { AllowWarnings *bool `json:"allow_warnings,omitempty"` // Validation policy: If true, the project can be committed with warnings when `validation_required` is true. (`allow_warnings` does nothing if `validation_required` is false). IsExample *bool `json:"is_example,omitempty"` // If true the project is an example project and cannot be modified DependencyStatus *string `json:"dependency_status,omitempty"` // Status of dependencies in your manifest & lockfile + DataTestsCount *int64 `json:"data_tests_count,omitempty"` // Number of data tests within project } type ProjectError struct { @@ -2543,6 +2544,7 @@ type RequestCreateDashboardRenderTask struct { PdfPaperSize *string `json:"pdf_paper_size,omitempty"` // Paper size for pdf. Value can be one of: ["letter","legal","tabloid","a0","a1","a2","a3","a4","a5"] PdfLandscape *bool `json:"pdf_landscape,omitempty"` // Whether to render pdf in landscape paper orientation LongTables *bool `json:"long_tables,omitempty"` // Whether or not to expand table vis to full length + Theme *string `json:"theme,omitempty"` // Theme to apply. Will render embedded version of dashboard if valid } // Dynamically generated request type for create_query_task @@ -2763,10 +2765,10 @@ type RequestSearchBoards struct { Favorited *bool `json:"favorited,omitempty"` // Return favorited boards when true. CreatorId *string `json:"creator_id,omitempty"` // Filter on boards created by a particular user. Sorts *string `json:"sorts,omitempty"` // The fields to sort the results by - Page *int64 `json:"page,omitempty"` // The page to return. DEPRECATED. Use offset instead. - PerPage *int64 `json:"per_page,omitempty"` // The number of items in the returned page. DEPRECATED. Use limit instead. - Offset *int64 `json:"offset,omitempty"` // The number of items to skip before returning any. (used with limit and takes priority over page and per_page) - Limit *int64 `json:"limit,omitempty"` // The maximum number of items to return. (used with offset and takes priority over page and per_page) + Page *int64 `json:"page,omitempty"` // DEPRECATED. Use limit and offset instead. Return only page N of paginated results + PerPage *int64 `json:"per_page,omitempty"` // DEPRECATED. Use limit and offset instead. Return N rows of data per page + Offset *int64 `json:"offset,omitempty"` // Number of results to return. (used with offset and takes priority over page and per_page) + Limit *int64 `json:"limit,omitempty"` // Number of results to skip before returning any. (used with limit and takes priority over page and per_page) FilterOr *bool `json:"filter_or,omitempty"` // Combine given search criteria in a boolean OR expression Permission *string `json:"permission,omitempty"` // Filter results based on permission, either show (default) or update } @@ -2778,8 +2780,8 @@ type RequestSearchContent struct { Types *string `json:"types,omitempty"` // Content types requested (dashboard, look, lookml_dashboard). Limit *int64 `json:"limit,omitempty"` // Number of results to return. (used with offset and takes priority over page and per_page) Offset *int64 `json:"offset,omitempty"` // Number of results to skip before returning any. (used with limit and takes priority over page and per_page) - Page *int64 `json:"page,omitempty"` // Requested page. - PerPage *int64 `json:"per_page,omitempty"` // Results per page. + Page *int64 `json:"page,omitempty"` // DEPRECATED. Use limit and offset instead. Return only page N of paginated results + PerPage *int64 `json:"per_page,omitempty"` // DEPRECATED. Use limit and offset instead. Return N rows of data per page } // Dynamically generated request type for search_content_favorites @@ -2844,7 +2846,7 @@ type RequestSearchDashboards struct { Title *string `json:"title,omitempty"` // Match Dashboard title. Description *string `json:"description,omitempty"` // Match Dashboard description. ContentFavoriteId *string `json:"content_favorite_id,omitempty"` // Filter on a content favorite id. - FolderId *string `json:"folder_id,omitempty"` // Filter on a particular space. + FolderId *string `json:"folder_id,omitempty"` // Filter on a particular folder. Deleted *string `json:"deleted,omitempty"` // Filter on dashboards deleted status. UserId *string `json:"user_id,omitempty"` // Filter on dashboards created by a particular user. ViewCount *string `json:"view_count,omitempty"` // Filter on a particular value of view_count @@ -3434,6 +3436,18 @@ type Snippet struct { Sql *string `json:"sql,omitempty"` // SQL text of the snippet } +type SqlInterfaceQuery struct { + Can *map[string]bool `json:"can,omitempty"` // Operations the current user is able to perform on this object + Id *int64 `json:"id,omitempty"` // Unique Id + Signature string `json:"signature"` // Calcite signature +} + +type SqlInterfaceQueryCreate struct { + Can *map[string]bool `json:"can,omitempty"` // Operations the current user is able to perform on this object + Sql string `json:"sql"` // Original SQL request + JdbcClient *bool `json:"jdbc_client,omitempty"` // Whether the query should be run for use in a JDBC Client. This changes the formatting of some datetime based values. +} + type SqlQuery struct { Can *map[string]bool `json:"can,omitempty"` // Operations the current user is able to perform on this object Slug *string `json:"slug,omitempty"` // The identifier of the SQL query @@ -3808,7 +3822,7 @@ type Workspace struct { type WriteAlert struct { AppliedDashboardFilters *[]AlertAppliedDashboardFilter `json:"applied_dashboard_filters,omitempty"` // Filters coming from the dashboard that are applied. Example `[{ "filter_title": "Name", "field_name": "distribution_centers.name", "filter_value": "Los Angeles CA" }]` ComparisonType ComparisonType `json:"comparison_type"` // This property informs the check what kind of comparison we are performing. Only certain condition types are valid for time series alerts. For details, refer to [Setting Alert Conditions](https://cloud.google.com/looker/docs/sharing-and-publishing/creating-alerts#setting_alert_conditions) Valid values are: "EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL_TO", "LESS_THAN", "LESS_THAN_OR_EQUAL_TO", "INCREASES_BY", "DECREASES_BY", "CHANGES_BY". - Cron string `json:"cron"` // Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals + Cron string `json:"cron"` // Vixie-Style crontab specification when to run. At minimum, it has to be longer than 15 minute intervals CustomUrlBase *string `json:"custom_url_base,omitempty"` // Domain for the custom url selected by the alert creator from the admin defined domain allowlist CustomUrlParams *string `json:"custom_url_params,omitempty"` // Parameters and path for the custom url defined by the alert creator CustomUrlLabel *string `json:"custom_url_label,omitempty"` // Label for the custom url defined by the alert creator @@ -4363,7 +4377,7 @@ type WritePrivatelabelConfiguration struct { } // Dynamic writeable type for Project removes: -// can, id, uses_git, is_example +// can, id, uses_git, is_example, data_tests_count type WriteProject struct { Name *string `json:"name,omitempty"` // Project display name GitRemoteUrl *string `json:"git_remote_url,omitempty"` // Git remote repository url @@ -4533,6 +4547,13 @@ type WriteSetting struct { EmbedConfig *EmbedConfig `json:"embed_config,omitempty"` } +// Dynamic writeable type for SqlInterfaceQueryCreate removes: +// can +type WriteSqlInterfaceQueryCreate struct { + Sql string `json:"sql"` // Original SQL request + JdbcClient *bool `json:"jdbc_client,omitempty"` // Whether the query should be run for use in a JDBC Client. This changes the formatting of some datetime based values. +} + // Dynamic writeable type for SshServer removes: // ssh_server_id, finger_print, sha_finger_print, public_key, status type WriteSshServer struct { diff --git a/kotlin/src/main/com/looker/sdk/4.0/methods.kt b/kotlin/src/main/com/looker/sdk/4.0/methods.kt index 6327207c4..68dd47932 100644 --- a/kotlin/src/main/com/looker/sdk/4.0/methods.kt +++ b/kotlin/src/main/com/looker/sdk/4.0/methods.kt @@ -25,7 +25,7 @@ */ /** - * 461 API methods + * 464 API methods */ @@ -746,6 +746,21 @@ class LookerSDK(authSession: AuthSession) : APIMethods(authSession) { } + /** + * ### Validate a Signed Embed URL + * + * @param {String} url URL to validate + * + * GET /embed/sso/validate -> EmbedUrlResponse + */ + @JvmOverloads fun validate_embed_url( + url: String? = null + ) : SDKResponse { + return this.get("/embed/sso/validate", + mapOf("url" to url)) + } + + /** * ### Acquire a cookieless embed session. * @@ -1787,10 +1802,10 @@ class LookerSDK(authSession: AuthSession) : APIMethods(authSession) { * @param {Boolean} favorited Return favorited boards when true. * @param {String} creator_id Filter on boards created by a particular user. * @param {String} sorts The fields to sort the results by - * @param {Long} page The page to return. DEPRECATED. Use offset instead. - * @param {Long} per_page The number of items in the returned page. DEPRECATED. Use limit instead. - * @param {Long} offset The number of items to skip before returning any. (used with limit and takes priority over page and per_page) - * @param {Long} limit The maximum number of items to return. (used with offset and takes priority over page and per_page) + * @param {Long} page DEPRECATED. Use limit and offset instead. Return only page N of paginated results + * @param {Long} per_page DEPRECATED. Use limit and offset instead. Return N rows of data per page + * @param {Long} offset Number of results to return. (used with offset and takes priority over page and per_page) + * @param {Long} limit Number of results to skip before returning any. (used with limit and takes priority over page and per_page) * @param {Boolean} filter_or Combine given search criteria in a boolean OR expression * @param {String} permission Filter results based on permission, either show (default) or update * @@ -2664,7 +2679,10 @@ class LookerSDK(authSession: AuthSession) : APIMethods(authSession) { /** * ### This feature is enabled only by special license. - * ### Gets the whitelabel configuration, which includes hiding documentation links, custom favicon uploading, etc. + * + * This endpoint provides the private label configuration, which includes hiding documentation links, custom favicon uploading, etc. + * + * This endpoint is deprecated. [Get Setting](#!/Config/get_setting) should be used to retrieve private label settings instead * * @param {String} fields Requested fields. * @@ -2680,7 +2698,9 @@ class LookerSDK(authSession: AuthSession) : APIMethods(authSession) { /** - * ### Update the whitelabel configuration + * ### Update the private label configuration + * + * This endpoint is deprecated. [Set Setting](#!/Config/set_setting) should be used to update private label settings instead * * @param {WriteWhitelabelConfiguration} body * @@ -3358,8 +3378,8 @@ class LookerSDK(authSession: AuthSession) : APIMethods(authSession) { * @param {String} types Content types requested (dashboard, look, lookml_dashboard). * @param {Long} limit Number of results to return. (used with offset and takes priority over page and per_page) * @param {Long} offset Number of results to skip before returning any. (used with limit and takes priority over page and per_page) - * @param {Long} page Requested page. - * @param {Long} per_page Results per page. + * @param {Long} page DEPRECATED. Use limit and offset instead. Return only page N of paginated results + * @param {Long} per_page DEPRECATED. Use limit and offset instead. Return N rows of data per page * * GET /content/{terms} -> Array */ @@ -3627,7 +3647,7 @@ class LookerSDK(authSession: AuthSession) : APIMethods(authSession) { * @param {String} title Match Dashboard title. * @param {String} description Match Dashboard description. * @param {String} content_favorite_id Filter on a content favorite id. - * @param {String} folder_id Filter on a particular space. + * @param {String} folder_id Filter on a particular folder. * @param {String} deleted Filter on dashboards deleted status. * @param {String} user_id Filter on dashboards created by a particular user. * @param {String} view_count Filter on a particular value of view_count @@ -4626,10 +4646,7 @@ class LookerSDK(authSession: AuthSession) : APIMethods(authSession) { /** * ### Get information about all folders. * - * In API 3.x, this will not return empty personal folders, unless they belong to the calling user, - * or if they contain soft-deleted content. - * - * In API 4.0+, all personal folders will be returned. + * All personal folders will be returned. * * @param {String} fields Requested fields. * @@ -4755,7 +4772,6 @@ class LookerSDK(authSession: AuthSession) : APIMethods(authSession) { /** * ### Get all looks in a folder. - * In API 3.x, this will return all looks in a folder, including looks in the trash. * In API 4.0+, all looks in a folder will be returned, excluding looks in the trash. * * @param {String} folder_id Id of folder @@ -5672,7 +5688,7 @@ class LookerSDK(authSession: AuthSession) : APIMethods(authSession) { * * Soft-deleted looks are excluded from the results of [all_looks()](#!/Look/all_looks) and [search_looks()](#!/Look/search_looks), so they * essentially disappear from view even though they still reside in the db. - * In API 3.1 and later, you can pass `deleted: true` as a parameter to [search_looks()](#!/3.1/Look/search_looks) to list soft-deleted looks. + * You can pass `deleted: true` as a parameter to [search_looks()](#!/Look/search_looks) to list soft-deleted looks. * * NOTE: [delete_look()](#!/Look/delete_look) performs a "hard delete" - the look data is removed from the Looker * database and destroyed. There is no "undo" for `delete_look()`. @@ -5725,7 +5741,8 @@ class LookerSDK(authSession: AuthSession) : APIMethods(authSession) { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -7154,7 +7171,8 @@ class LookerSDK(authSession: AuthSession) : APIMethods(authSession) { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -7262,7 +7280,8 @@ class LookerSDK(authSession: AuthSession) : APIMethods(authSession) { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -7342,7 +7361,7 @@ class LookerSDK(authSession: AuthSession) : APIMethods(authSession) { * Here is an example inline query URL: * * ``` - * https://looker.mycompany.com:19999/api/3.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles + * https://looker.mycompany.com:19999/api/4.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles * ``` * * When invoking this endpoint with the Ruby SDK, pass the query parameter parts as a hash. The hash to match the above would look like: @@ -7368,7 +7387,8 @@ class LookerSDK(authSession: AuthSession) : APIMethods(authSession) { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -7479,17 +7499,63 @@ class LookerSDK(authSession: AuthSession) : APIMethods(authSession) { /** - * Get a SQL Runner query. + * ### Run a saved SQL interface query. * - * @param {String} slug slug of query + * This runs a previously created SQL interface query. * - * GET /sql_queries/{slug} -> SqlQuery + * The 'result_format' parameter specifies the desired structure and format of the response. + * + * Supported formats: + * + * | result_format | Description + * | :-----------: | :--- | + * | json | Plain json + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | csv | Comma separated values with a header + * | txt | Tab separated values with a header + * | html | Simple html + * | md | Simple markdown + * | xlsx | MS Excel spreadsheet + * | sql | Returns the generated SQL rather than running the query + * | png | A PNG image of the visualization of the query + * | jpg | A JPG image of the visualization of the query + * + * @param {Long} query_id Integer id of query + * @param {String} result_format Format of result, options are: ["json_bi"] + * + * GET /sql_interface_queries/{query_id}/run/{result_format} -> String + * + * **Note**: Binary content may be returned by this method. */ - fun sql_query( - slug: String + fun run_sql_interface_query( + query_id: Long, + result_format: String ) : SDKResponse { - val path_slug = encodeParam(slug) - return this.get("/sql_queries/${path_slug}", mapOf()) + val path_query_id = encodeParam(query_id) + val path_result_format = encodeParam(result_format) + return this.get("/sql_interface_queries/${path_query_id}/run/${path_result_format}", mapOf()) + } + + + /** + * ### Create a SQL interface query. + * + * This allows you to create a new SQL interface query that you can later run. Looker queries are immutable once created + * and are not deleted. If you create a query that is exactly like an existing query then the existing query + * will be returned and no new query will be created. Whether a new query is created or not, you can use + * the 'id' in the returned query with the 'run' method. + * + * The query parameters are passed as json in the body of the request. + * + * @param {WriteSqlInterfaceQueryCreate} body + * + * POST /sql_interface_queries -> SqlInterfaceQuery + */ + fun create_sql_interface_query( + body: WriteSqlInterfaceQueryCreate + ) : SDKResponse { + return this.post("/sql_interface_queries", mapOf(), body) } @@ -7509,6 +7575,21 @@ class LookerSDK(authSession: AuthSession) : APIMethods(authSession) { } + /** + * Get a SQL Runner query. + * + * @param {String} slug slug of query + * + * GET /sql_queries/{slug} -> SqlQuery + */ + fun sql_query( + slug: String + ) : SDKResponse { + val path_slug = encodeParam(slug) + return this.get("/sql_queries/${path_slug}", mapOf()) + } + + /** * Execute a SQL Runner query in a given result_format. * @@ -7614,6 +7695,7 @@ class LookerSDK(authSession: AuthSession) : APIMethods(authSession) { * @param {String} pdf_paper_size Paper size for pdf. Value can be one of: ["letter","legal","tabloid","a0","a1","a2","a3","a4","a5"] * @param {Boolean} pdf_landscape Whether to render pdf in landscape paper orientation * @param {Boolean} long_tables Whether or not to expand table vis to full length + * @param {String} theme Theme to apply. Will render embedded version of dashboard if valid * * POST /render_tasks/dashboards/{dashboard_id}/{result_format} -> RenderTask */ @@ -7626,7 +7708,8 @@ class LookerSDK(authSession: AuthSession) : APIMethods(authSession) { fields: String? = null, pdf_paper_size: String? = null, pdf_landscape: Boolean? = null, - long_tables: Boolean? = null + long_tables: Boolean? = null, + theme: String? = null ) : SDKResponse { val path_dashboard_id = encodeParam(dashboard_id) val path_result_format = encodeParam(result_format) @@ -7636,7 +7719,8 @@ class LookerSDK(authSession: AuthSession) : APIMethods(authSession) { "fields" to fields, "pdf_paper_size" to pdf_paper_size, "pdf_landscape" to pdf_landscape, - "long_tables" to long_tables), body) + "long_tables" to long_tables, + "theme" to theme), body) } diff --git a/kotlin/src/main/com/looker/sdk/4.0/models.kt b/kotlin/src/main/com/looker/sdk/4.0/models.kt index f919f77de..533b1632f 100644 --- a/kotlin/src/main/com/looker/sdk/4.0/models.kt +++ b/kotlin/src/main/com/looker/sdk/4.0/models.kt @@ -25,7 +25,7 @@ */ /** - * 329 API models: 247 Spec, 0 Request, 60 Write, 22 Enum + * 332 API models: 249 Spec, 0 Request, 61 Write, 22 Enum */ @@ -53,7 +53,7 @@ data class AccessToken ( /** * @property applied_dashboard_filters Filters coming from the dashboard that are applied. Example `[{ "filter_title": "Name", "field_name": "distribution_centers.name", "filter_value": "Los Angeles CA" }]` * @property comparison_type This property informs the check what kind of comparison we are performing. Only certain condition types are valid for time series alerts. For details, refer to [Setting Alert Conditions](https://cloud.google.com/looker/docs/sharing-and-publishing/creating-alerts#setting_alert_conditions) Valid values are: "EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL_TO", "LESS_THAN", "LESS_THAN_OR_EQUAL_TO", "INCREASES_BY", "DECREASES_BY", "CHANGES_BY". - * @property cron Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals + * @property cron Vixie-Style crontab specification when to run. At minimum, it has to be longer than 15 minute intervals * @property custom_url_base Domain for the custom url selected by the alert creator from the admin defined domain allowlist * @property custom_url_params Parameters and path for the custom url defined by the alert creator * @property custom_url_label Label for the custom url defined by the alert creator @@ -1903,7 +1903,7 @@ enum class DeviceType : Serializable { * @property persistent_table_indexes PDT index columns (read-only) * @property persistent_table_sortkeys PDT sortkey columns (read-only) * @property persistent_table_distkey PDT distkey column (read-only) - * @property supports_streaming Suports streaming results (read-only) + * @property supports_streaming Supports streaming results (read-only) * @property automatically_run_sql_runner_snippets Should SQL Runner snippets automatically be run (read-only) * @property connection_tests Array of names of the tests that can be run on a connection using this dialect (read-only) * @property supports_inducer Is supported with the inducer (i.e. generate from sql) (read-only) @@ -2698,8 +2698,8 @@ data class IntegrationParam ( /** * @property tag Matches a field that has this tag. (read-only) - * @property any_tag If present, supercedes 'tag' and matches a field that has any of the provided tags. (read-only) - * @property all_tags If present, supercedes 'tag' and matches a field that has all of the provided tags. (read-only) + * @property any_tag If present, supersedes 'tag' and matches a field that has any of the provided tags. (read-only) + * @property all_tags If present, supersedes 'tag' and matches a field that has all of the provided tags. (read-only) */ data class IntegrationRequiredField ( var tag: String? = null, @@ -4144,6 +4144,7 @@ data class PrivatelabelConfiguration ( * @property allow_warnings Validation policy: If true, the project can be committed with warnings when `validation_required` is true. (`allow_warnings` does nothing if `validation_required` is false). * @property is_example If true the project is an example project and cannot be modified (read-only) * @property dependency_status Status of dependencies in your manifest & lockfile + * @property data_tests_count Number of data tests within project (read-only) */ data class Project ( var can: Map? = null, @@ -4167,7 +4168,8 @@ data class Project ( var git_release_mgmt_enabled: Boolean? = null, var allow_warnings: Boolean? = null, var is_example: Boolean? = null, - var dependency_status: String? = null + var dependency_status: String? = null, + var data_tests_count: Long? = null ) : Serializable /** @@ -5091,6 +5093,28 @@ data class Snippet ( var sql: String? = null ) : Serializable +/** + * @property can Operations the current user is able to perform on this object (read-only) + * @property id Unique Id (read-only) + * @property signature Calcite signature (read-only) + */ +data class SqlInterfaceQuery ( + var can: Map? = null, + var id: Long? = null, + var signature: String +) : Serializable + +/** + * @property can Operations the current user is able to perform on this object (read-only) + * @property sql Original SQL request + * @property jdbc_client Whether the query should be run for use in a JDBC Client. This changes the formatting of some datetime based values. + */ +data class SqlInterfaceQueryCreate ( + var can: Map? = null, + var sql: String, + var jdbc_client: Boolean? = null +) : Serializable + /** * @property can Operations the current user is able to perform on this object (read-only) * @property slug The identifier of the SQL query (read-only) @@ -5767,7 +5791,7 @@ data class Workspace ( * * @property applied_dashboard_filters Filters coming from the dashboard that are applied. Example `[{ "filter_title": "Name", "field_name": "distribution_centers.name", "filter_value": "Los Angeles CA" }]` * @property comparison_type This property informs the check what kind of comparison we are performing. Only certain condition types are valid for time series alerts. For details, refer to [Setting Alert Conditions](https://cloud.google.com/looker/docs/sharing-and-publishing/creating-alerts#setting_alert_conditions) Valid values are: "EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL_TO", "LESS_THAN", "LESS_THAN_OR_EQUAL_TO", "INCREASES_BY", "DECREASES_BY", "CHANGES_BY". - * @property cron Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals + * @property cron Vixie-Style crontab specification when to run. At minimum, it has to be longer than 15 minute intervals * @property custom_url_base Domain for the custom url selected by the alert creator from the admin defined domain allowlist * @property custom_url_params Parameters and path for the custom url defined by the alert creator * @property custom_url_label Label for the custom url defined by the alert creator @@ -6783,7 +6807,7 @@ data class WritePrivatelabelConfiguration ( /** * Dynamic writeable type for Project removes: - * can, id, uses_git, is_example + * can, id, uses_git, is_example, data_tests_count * * @property name Project display name * @property git_remote_url Git remote repository url @@ -7101,6 +7125,18 @@ data class WriteSetting ( var embed_config: EmbedConfig? = null ) : Serializable +/** + * Dynamic writeable type for SqlInterfaceQueryCreate removes: + * can + * + * @property sql Original SQL request + * @property jdbc_client Whether the query should be run for use in a JDBC Client. This changes the formatting of some datetime based values. + */ +data class WriteSqlInterfaceQueryCreate ( + var sql: String, + var jdbc_client: Boolean? = null +) : Serializable + /** * Dynamic writeable type for SshServer removes: * ssh_server_id, finger_print, sha_finger_print, public_key, status diff --git a/kotlin/src/main/com/looker/sdk/4.0/streams.kt b/kotlin/src/main/com/looker/sdk/4.0/streams.kt index f8949d669..037e7bf60 100644 --- a/kotlin/src/main/com/looker/sdk/4.0/streams.kt +++ b/kotlin/src/main/com/looker/sdk/4.0/streams.kt @@ -25,7 +25,7 @@ */ /** - * 461 API methods + * 464 API methods */ @@ -745,6 +745,21 @@ class LookerSDKStream(authSession: AuthSession) : APIMethods(authSession) { } + /** + * ### Validate a Signed Embed URL + * + * @param {String} url URL to validate + * + * GET /embed/sso/validate -> ByteArray + */ + @JvmOverloads fun validate_embed_url( + url: String? = null + ) : SDKResponse { + return this.get("/embed/sso/validate", + mapOf("url" to url)) + } + + /** * ### Acquire a cookieless embed session. * @@ -1786,10 +1801,10 @@ class LookerSDKStream(authSession: AuthSession) : APIMethods(authSession) { * @param {Boolean} favorited Return favorited boards when true. * @param {String} creator_id Filter on boards created by a particular user. * @param {String} sorts The fields to sort the results by - * @param {Long} page The page to return. DEPRECATED. Use offset instead. - * @param {Long} per_page The number of items in the returned page. DEPRECATED. Use limit instead. - * @param {Long} offset The number of items to skip before returning any. (used with limit and takes priority over page and per_page) - * @param {Long} limit The maximum number of items to return. (used with offset and takes priority over page and per_page) + * @param {Long} page DEPRECATED. Use limit and offset instead. Return only page N of paginated results + * @param {Long} per_page DEPRECATED. Use limit and offset instead. Return N rows of data per page + * @param {Long} offset Number of results to return. (used with offset and takes priority over page and per_page) + * @param {Long} limit Number of results to skip before returning any. (used with limit and takes priority over page and per_page) * @param {Boolean} filter_or Combine given search criteria in a boolean OR expression * @param {String} permission Filter results based on permission, either show (default) or update * @@ -2663,7 +2678,10 @@ class LookerSDKStream(authSession: AuthSession) : APIMethods(authSession) { /** * ### This feature is enabled only by special license. - * ### Gets the whitelabel configuration, which includes hiding documentation links, custom favicon uploading, etc. + * + * This endpoint provides the private label configuration, which includes hiding documentation links, custom favicon uploading, etc. + * + * This endpoint is deprecated. [Get Setting](#!/Config/get_setting) should be used to retrieve private label settings instead * * @param {String} fields Requested fields. * @@ -2679,7 +2697,9 @@ class LookerSDKStream(authSession: AuthSession) : APIMethods(authSession) { /** - * ### Update the whitelabel configuration + * ### Update the private label configuration + * + * This endpoint is deprecated. [Set Setting](#!/Config/set_setting) should be used to update private label settings instead * * @param {WriteWhitelabelConfiguration} body * @@ -3357,8 +3377,8 @@ class LookerSDKStream(authSession: AuthSession) : APIMethods(authSession) { * @param {String} types Content types requested (dashboard, look, lookml_dashboard). * @param {Long} limit Number of results to return. (used with offset and takes priority over page and per_page) * @param {Long} offset Number of results to skip before returning any. (used with limit and takes priority over page and per_page) - * @param {Long} page Requested page. - * @param {Long} per_page Results per page. + * @param {Long} page DEPRECATED. Use limit and offset instead. Return only page N of paginated results + * @param {Long} per_page DEPRECATED. Use limit and offset instead. Return N rows of data per page * * GET /content/{terms} -> ByteArray */ @@ -3626,7 +3646,7 @@ class LookerSDKStream(authSession: AuthSession) : APIMethods(authSession) { * @param {String} title Match Dashboard title. * @param {String} description Match Dashboard description. * @param {String} content_favorite_id Filter on a content favorite id. - * @param {String} folder_id Filter on a particular space. + * @param {String} folder_id Filter on a particular folder. * @param {String} deleted Filter on dashboards deleted status. * @param {String} user_id Filter on dashboards created by a particular user. * @param {String} view_count Filter on a particular value of view_count @@ -4625,10 +4645,7 @@ class LookerSDKStream(authSession: AuthSession) : APIMethods(authSession) { /** * ### Get information about all folders. * - * In API 3.x, this will not return empty personal folders, unless they belong to the calling user, - * or if they contain soft-deleted content. - * - * In API 4.0+, all personal folders will be returned. + * All personal folders will be returned. * * @param {String} fields Requested fields. * @@ -4754,7 +4771,6 @@ class LookerSDKStream(authSession: AuthSession) : APIMethods(authSession) { /** * ### Get all looks in a folder. - * In API 3.x, this will return all looks in a folder, including looks in the trash. * In API 4.0+, all looks in a folder will be returned, excluding looks in the trash. * * @param {String} folder_id Id of folder @@ -5671,7 +5687,7 @@ class LookerSDKStream(authSession: AuthSession) : APIMethods(authSession) { * * Soft-deleted looks are excluded from the results of [all_looks()](#!/Look/all_looks) and [search_looks()](#!/Look/search_looks), so they * essentially disappear from view even though they still reside in the db. - * In API 3.1 and later, you can pass `deleted: true` as a parameter to [search_looks()](#!/3.1/Look/search_looks) to list soft-deleted looks. + * You can pass `deleted: true` as a parameter to [search_looks()](#!/Look/search_looks) to list soft-deleted looks. * * NOTE: [delete_look()](#!/Look/delete_look) performs a "hard delete" - the look data is removed from the Looker * database and destroyed. There is no "undo" for `delete_look()`. @@ -5724,7 +5740,8 @@ class LookerSDKStream(authSession: AuthSession) : APIMethods(authSession) { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -7153,7 +7170,8 @@ class LookerSDKStream(authSession: AuthSession) : APIMethods(authSession) { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -7261,7 +7279,8 @@ class LookerSDKStream(authSession: AuthSession) : APIMethods(authSession) { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -7341,7 +7360,7 @@ class LookerSDKStream(authSession: AuthSession) : APIMethods(authSession) { * Here is an example inline query URL: * * ``` - * https://looker.mycompany.com:19999/api/3.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles + * https://looker.mycompany.com:19999/api/4.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles * ``` * * When invoking this endpoint with the Ruby SDK, pass the query parameter parts as a hash. The hash to match the above would look like: @@ -7367,7 +7386,8 @@ class LookerSDKStream(authSession: AuthSession) : APIMethods(authSession) { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -7478,17 +7498,63 @@ class LookerSDKStream(authSession: AuthSession) : APIMethods(authSession) { /** - * Get a SQL Runner query. + * ### Run a saved SQL interface query. * - * @param {String} slug slug of query + * This runs a previously created SQL interface query. * - * GET /sql_queries/{slug} -> ByteArray + * The 'result_format' parameter specifies the desired structure and format of the response. + * + * Supported formats: + * + * | result_format | Description + * | :-----------: | :--- | + * | json | Plain json + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | csv | Comma separated values with a header + * | txt | Tab separated values with a header + * | html | Simple html + * | md | Simple markdown + * | xlsx | MS Excel spreadsheet + * | sql | Returns the generated SQL rather than running the query + * | png | A PNG image of the visualization of the query + * | jpg | A JPG image of the visualization of the query + * + * @param {Long} query_id Integer id of query + * @param {String} result_format Format of result, options are: ["json_bi"] + * + * GET /sql_interface_queries/{query_id}/run/{result_format} -> ByteArray + * + * **Note**: Binary content may be returned by this method. */ - fun sql_query( - slug: String + fun run_sql_interface_query( + query_id: Long, + result_format: String ) : SDKResponse { - val path_slug = encodeParam(slug) - return this.get("/sql_queries/${path_slug}", mapOf()) + val path_query_id = encodeParam(query_id) + val path_result_format = encodeParam(result_format) + return this.get("/sql_interface_queries/${path_query_id}/run/${path_result_format}", mapOf()) + } + + + /** + * ### Create a SQL interface query. + * + * This allows you to create a new SQL interface query that you can later run. Looker queries are immutable once created + * and are not deleted. If you create a query that is exactly like an existing query then the existing query + * will be returned and no new query will be created. Whether a new query is created or not, you can use + * the 'id' in the returned query with the 'run' method. + * + * The query parameters are passed as json in the body of the request. + * + * @param {WriteSqlInterfaceQueryCreate} body + * + * POST /sql_interface_queries -> ByteArray + */ + fun create_sql_interface_query( + body: WriteSqlInterfaceQueryCreate + ) : SDKResponse { + return this.post("/sql_interface_queries", mapOf(), body) } @@ -7508,6 +7574,21 @@ class LookerSDKStream(authSession: AuthSession) : APIMethods(authSession) { } + /** + * Get a SQL Runner query. + * + * @param {String} slug slug of query + * + * GET /sql_queries/{slug} -> ByteArray + */ + fun sql_query( + slug: String + ) : SDKResponse { + val path_slug = encodeParam(slug) + return this.get("/sql_queries/${path_slug}", mapOf()) + } + + /** * Execute a SQL Runner query in a given result_format. * @@ -7613,6 +7694,7 @@ class LookerSDKStream(authSession: AuthSession) : APIMethods(authSession) { * @param {String} pdf_paper_size Paper size for pdf. Value can be one of: ["letter","legal","tabloid","a0","a1","a2","a3","a4","a5"] * @param {Boolean} pdf_landscape Whether to render pdf in landscape paper orientation * @param {Boolean} long_tables Whether or not to expand table vis to full length + * @param {String} theme Theme to apply. Will render embedded version of dashboard if valid * * POST /render_tasks/dashboards/{dashboard_id}/{result_format} -> ByteArray */ @@ -7625,7 +7707,8 @@ class LookerSDKStream(authSession: AuthSession) : APIMethods(authSession) { fields: String? = null, pdf_paper_size: String? = null, pdf_landscape: Boolean? = null, - long_tables: Boolean? = null + long_tables: Boolean? = null, + theme: String? = null ) : SDKResponse { val path_dashboard_id = encodeParam(dashboard_id) val path_result_format = encodeParam(result_format) @@ -7635,7 +7718,8 @@ class LookerSDKStream(authSession: AuthSession) : APIMethods(authSession) { "fields" to fields, "pdf_paper_size" to pdf_paper_size, "pdf_landscape" to pdf_landscape, - "long_tables" to long_tables), body) + "long_tables" to long_tables, + "theme" to theme), body) } diff --git a/kotlin/src/main/com/looker/sdk/Constants.kt b/kotlin/src/main/com/looker/sdk/Constants.kt index 257b160ec..e7cc6f4f5 100644 --- a/kotlin/src/main/com/looker/sdk/Constants.kt +++ b/kotlin/src/main/com/looker/sdk/Constants.kt @@ -28,7 +28,7 @@ package com.looker.sdk const val ENVIRONMENT_PREFIX = "LOOKERSDK" const val SDK_TAG = "KT-SDK" -const val LOOKER_VERSION = "23.14" +const val LOOKER_VERSION = "23.17" const val API_VERSION = "4.0" const val AGENT_TAG = "$SDK_TAG $LOOKER_VERSION" const val LOOKER_APPID = "x-looker-appid" diff --git a/packages/sdk/src/4.0/funcs.ts b/packages/sdk/src/4.0/funcs.ts index 599213e43..8e0e73789 100644 --- a/packages/sdk/src/4.0/funcs.ts +++ b/packages/sdk/src/4.0/funcs.ts @@ -25,7 +25,7 @@ */ /** - * 461 API methods + * 464 API methods */ import type { @@ -242,6 +242,7 @@ import type { ISetting, ISmtpSettings, ISmtpStatus, + ISqlInterfaceQuery, ISqlQuery, ISqlQueryCreate, ISshPublicKey, @@ -312,6 +313,7 @@ import type { IWriteScheduledPlan, IWriteSessionConfig, IWriteSetting, + IWriteSqlInterfaceQueryCreate, IWriteSshServer, IWriteSshTunnel, IWriteTheme, @@ -1196,6 +1198,29 @@ export const create_embed_url_as_me = async ( ) } +/** + * ### Validate a Signed Embed URL + * + * GET /embed/sso/validate -> IEmbedUrlResponse + * + * @param sdk IAPIMethods implementation + * @param url URL to validate + * @param options one-time API call overrides + * + */ +export const validate_embed_url = async ( + sdk: IAPIMethods, + url?: string, + options?: Partial +): Promise> => { + return sdk.get( + '/embed/sso/validate', + { url }, + null, + options + ) +} + /** * ### Acquire a cookieless embed session. * @@ -3858,7 +3883,10 @@ export const api_spec = async ( /** * ### This feature is enabled only by special license. - * ### Gets the whitelabel configuration, which includes hiding documentation links, custom favicon uploading, etc. + * + * This endpoint provides the private label configuration, which includes hiding documentation links, custom favicon uploading, etc. + * + * This endpoint is deprecated. [Get Setting](#!/Config/get_setting) should be used to retrieve private label settings instead * * GET /whitelabel_configuration -> IWhitelabelConfiguration * @@ -3883,7 +3911,9 @@ export const whitelabel_configuration = async ( } /** - * ### Update the whitelabel configuration + * ### Update the private label configuration + * + * This endpoint is deprecated. [Set Setting](#!/Config/set_setting) should be used to update private label settings instead * * PUT /whitelabel_configuration -> IWhitelabelConfiguration * @@ -6430,10 +6460,7 @@ export const delete_folder = async ( /** * ### Get information about all folders. * - * In API 3.x, this will not return empty personal folders, unless they belong to the calling user, - * or if they contain soft-deleted content. - * - * In API 4.0+, all personal folders will be returned. + * All personal folders will be returned. * * GET /folders -> IFolder[] * @@ -6585,7 +6612,6 @@ export const folder_ancestors = async ( /** * ### Get all looks in a folder. - * In API 3.x, this will return all looks in a folder, including looks in the trash. * In API 4.0+, all looks in a folder will be returned, excluding looks in the trash. * * GET /folders/{folder_id}/looks -> ILookWithQuery[] @@ -7678,7 +7704,7 @@ export const look = async ( * * Soft-deleted looks are excluded from the results of [all_looks()](#!/Look/all_looks) and [search_looks()](#!/Look/search_looks), so they * essentially disappear from view even though they still reside in the db. - * In API 3.1 and later, you can pass `deleted: true` as a parameter to [search_looks()](#!/3.1/Look/search_looks) to list soft-deleted looks. + * You can pass `deleted: true` as a parameter to [search_looks()](#!/Look/search_looks) to list soft-deleted looks. * * NOTE: [delete_look()](#!/Look/delete_look) performs a "hard delete" - the look data is removed from the Looker * database and destroyed. There is no "undo" for `delete_look()`. @@ -7743,7 +7769,8 @@ export const delete_look = async ( * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -9516,7 +9543,8 @@ export const create_query = async ( * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -9607,7 +9635,8 @@ export const run_query = async ( * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -9672,7 +9701,7 @@ export const run_inline_query = async ( * Here is an example inline query URL: * * ``` - * https://looker.mycompany.com:19999/api/3.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles + * https://looker.mycompany.com:19999/api/4.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles * ``` * * When invoking this endpoint with the Ruby SDK, pass the query parameter parts as a hash. The hash to match the above would look like: @@ -9698,7 +9727,8 @@ export const run_inline_query = async ( * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -9853,22 +9883,82 @@ export const kill_query = async ( } /** - * Get a SQL Runner query. + * ### Run a saved SQL interface query. * - * GET /sql_queries/{slug} -> ISqlQuery + * This runs a previously created SQL interface query. + * + * The 'result_format' parameter specifies the desired structure and format of the response. + * + * Supported formats: + * + * | result_format | Description + * | :-----------: | :--- | + * | json | Plain json + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | csv | Comma separated values with a header + * | txt | Tab separated values with a header + * | html | Simple html + * | md | Simple markdown + * | xlsx | MS Excel spreadsheet + * | sql | Returns the generated SQL rather than running the query + * | png | A PNG image of the visualization of the query + * | jpg | A JPG image of the visualization of the query + * + * GET /sql_interface_queries/{query_id}/run/{result_format} -> string + * + * @remarks + * **NOTE**: Binary content may be returned by this function. * * @param sdk IAPIMethods implementation - * @param slug slug of query + * @param query_id Integer id of query + * @param result_format Format of result, options are: ["json_bi"] * @param options one-time API call overrides * */ -export const sql_query = async ( +export const run_sql_interface_query = async ( sdk: IAPIMethods, - slug: string, + query_id: number, + result_format: string, options?: Partial -): Promise> => { - slug = encodeParam(slug) - return sdk.get(`/sql_queries/${slug}`, null, null, options) +): Promise> => { + result_format = encodeParam(result_format) + return sdk.get( + `/sql_interface_queries/${query_id}/run/${result_format}`, + null, + null, + options + ) +} + +/** + * ### Create a SQL interface query. + * + * This allows you to create a new SQL interface query that you can later run. Looker queries are immutable once created + * and are not deleted. If you create a query that is exactly like an existing query then the existing query + * will be returned and no new query will be created. Whether a new query is created or not, you can use + * the 'id' in the returned query with the 'run' method. + * + * The query parameters are passed as json in the body of the request. + * + * POST /sql_interface_queries -> ISqlInterfaceQuery + * + * @param sdk IAPIMethods implementation + * @param body Partial + * @param options one-time API call overrides + * + */ +export const create_sql_interface_query = async ( + sdk: IAPIMethods, + body: Partial, + options?: Partial +): Promise> => { + return sdk.post( + '/sql_interface_queries', + null, + body, + options + ) } /** @@ -9896,6 +9986,25 @@ export const create_sql_query = async ( ) } +/** + * Get a SQL Runner query. + * + * GET /sql_queries/{slug} -> ISqlQuery + * + * @param sdk IAPIMethods implementation + * @param slug slug of query + * @param options one-time API call overrides + * + */ +export const sql_query = async ( + sdk: IAPIMethods, + slug: string, + options?: Partial +): Promise> => { + slug = encodeParam(slug) + return sdk.get(`/sql_queries/${slug}`, null, null, options) +} + /** * Execute a SQL Runner query in a given result_format. * @@ -10036,6 +10145,7 @@ export const create_dashboard_render_task = async ( pdf_paper_size: request.pdf_paper_size, pdf_landscape: request.pdf_landscape, long_tables: request.long_tables, + theme: request.theme, }, request.body, options diff --git a/packages/sdk/src/4.0/methods.ts b/packages/sdk/src/4.0/methods.ts index 3faf5409f..4e94032e7 100644 --- a/packages/sdk/src/4.0/methods.ts +++ b/packages/sdk/src/4.0/methods.ts @@ -25,7 +25,7 @@ */ /** - * 461 API methods + * 464 API methods */ import type { @@ -240,6 +240,7 @@ import type { ISetting, ISmtpSettings, ISmtpStatus, + ISqlInterfaceQuery, ISqlQuery, ISqlQueryCreate, ISshPublicKey, @@ -310,6 +311,7 @@ import type { IWriteScheduledPlan, IWriteSessionConfig, IWriteSetting, + IWriteSqlInterfaceQueryCreate, IWriteSshServer, IWriteSshTunnel, IWriteTheme, @@ -1145,6 +1147,27 @@ export class Looker40SDK extends APIMethods implements ILooker40SDK { ) } + /** + * ### Validate a Signed Embed URL + * + * GET /embed/sso/validate -> IEmbedUrlResponse + * + * @param url URL to validate + * @param options one-time API call overrides + * + */ + async validate_embed_url( + url?: string, + options?: Partial + ): Promise> { + return this.get( + '/embed/sso/validate', + { url }, + null, + options + ) + } + /** * ### Acquire a cookieless embed session. * @@ -3633,7 +3656,10 @@ export class Looker40SDK extends APIMethods implements ILooker40SDK { /** * ### This feature is enabled only by special license. - * ### Gets the whitelabel configuration, which includes hiding documentation links, custom favicon uploading, etc. + * + * This endpoint provides the private label configuration, which includes hiding documentation links, custom favicon uploading, etc. + * + * This endpoint is deprecated. [Get Setting](#!/Config/get_setting) should be used to retrieve private label settings instead * * GET /whitelabel_configuration -> IWhitelabelConfiguration * @@ -3656,7 +3682,9 @@ export class Looker40SDK extends APIMethods implements ILooker40SDK { } /** - * ### Update the whitelabel configuration + * ### Update the private label configuration + * + * This endpoint is deprecated. [Set Setting](#!/Config/set_setting) should be used to update private label settings instead * * PUT /whitelabel_configuration -> IWhitelabelConfiguration * @@ -6028,10 +6056,7 @@ export class Looker40SDK extends APIMethods implements ILooker40SDK { /** * ### Get information about all folders. * - * In API 3.x, this will not return empty personal folders, unless they belong to the calling user, - * or if they contain soft-deleted content. - * - * In API 4.0+, all personal folders will be returned. + * All personal folders will be returned. * * GET /folders -> IFolder[] * @@ -6171,7 +6196,6 @@ export class Looker40SDK extends APIMethods implements ILooker40SDK { /** * ### Get all looks in a folder. - * In API 3.x, this will return all looks in a folder, including looks in the trash. * In API 4.0+, all looks in a folder will be returned, excluding looks in the trash. * * GET /folders/{folder_id}/looks -> ILookWithQuery[] @@ -7200,7 +7224,7 @@ export class Looker40SDK extends APIMethods implements ILooker40SDK { * * Soft-deleted looks are excluded from the results of [all_looks()](#!/Look/all_looks) and [search_looks()](#!/Look/search_looks), so they * essentially disappear from view even though they still reside in the db. - * In API 3.1 and later, you can pass `deleted: true` as a parameter to [search_looks()](#!/3.1/Look/search_looks) to list soft-deleted looks. + * You can pass `deleted: true` as a parameter to [search_looks()](#!/Look/search_looks) to list soft-deleted looks. * * NOTE: [delete_look()](#!/Look/delete_look) performs a "hard delete" - the look data is removed from the Looker * database and destroyed. There is no "undo" for `delete_look()`. @@ -7261,7 +7285,8 @@ export class Looker40SDK extends APIMethods implements ILooker40SDK { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -8928,7 +8953,8 @@ export class Looker40SDK extends APIMethods implements ILooker40SDK { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -9017,7 +9043,8 @@ export class Looker40SDK extends APIMethods implements ILooker40SDK { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -9080,7 +9107,7 @@ export class Looker40SDK extends APIMethods implements ILooker40SDK { * Here is an example inline query URL: * * ``` - * https://looker.mycompany.com:19999/api/3.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles + * https://looker.mycompany.com:19999/api/4.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles * ``` * * When invoking this endpoint with the Ruby SDK, pass the query parameter parts as a hash. The hash to match the above would look like: @@ -9106,7 +9133,8 @@ export class Looker40SDK extends APIMethods implements ILooker40SDK { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -9251,27 +9279,80 @@ export class Looker40SDK extends APIMethods implements ILooker40SDK { } /** - * Get a SQL Runner query. + * ### Run a saved SQL interface query. * - * GET /sql_queries/{slug} -> ISqlQuery + * This runs a previously created SQL interface query. * - * @param slug slug of query + * The 'result_format' parameter specifies the desired structure and format of the response. + * + * Supported formats: + * + * | result_format | Description + * | :-----------: | :--- | + * | json | Plain json + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | csv | Comma separated values with a header + * | txt | Tab separated values with a header + * | html | Simple html + * | md | Simple markdown + * | xlsx | MS Excel spreadsheet + * | sql | Returns the generated SQL rather than running the query + * | png | A PNG image of the visualization of the query + * | jpg | A JPG image of the visualization of the query + * + * GET /sql_interface_queries/{query_id}/run/{result_format} -> string + * + * @remarks + * **NOTE**: Binary content may be returned by this function. + * + * @param query_id Integer id of query + * @param result_format Format of result, options are: ["json_bi"] * @param options one-time API call overrides * */ - async sql_query( - slug: string, + async run_sql_interface_query( + query_id: number, + result_format: string, options?: Partial - ): Promise> { - slug = encodeParam(slug) - return this.get( - `/sql_queries/${slug}`, + ): Promise> { + result_format = encodeParam(result_format) + return this.get( + `/sql_interface_queries/${query_id}/run/${result_format}`, null, null, options ) } + /** + * ### Create a SQL interface query. + * + * This allows you to create a new SQL interface query that you can later run. Looker queries are immutable once created + * and are not deleted. If you create a query that is exactly like an existing query then the existing query + * will be returned and no new query will be created. Whether a new query is created or not, you can use + * the 'id' in the returned query with the 'run' method. + * + * The query parameters are passed as json in the body of the request. + * + * POST /sql_interface_queries -> ISqlInterfaceQuery + * + * @param body Partial + * @param options one-time API call overrides + * + */ + async create_sql_interface_query( + body: Partial, + options?: Partial + ): Promise> { + return this.post( + '/sql_interface_queries', + null, + body, + options + ) + } + /** * ### Create a SQL Runner Query * @@ -9295,6 +9376,28 @@ export class Looker40SDK extends APIMethods implements ILooker40SDK { ) } + /** + * Get a SQL Runner query. + * + * GET /sql_queries/{slug} -> ISqlQuery + * + * @param slug slug of query + * @param options one-time API call overrides + * + */ + async sql_query( + slug: string, + options?: Partial + ): Promise> { + slug = encodeParam(slug) + return this.get( + `/sql_queries/${slug}`, + null, + null, + options + ) + } + /** * Execute a SQL Runner query in a given result_format. * @@ -9427,6 +9530,7 @@ export class Looker40SDK extends APIMethods implements ILooker40SDK { pdf_paper_size: request.pdf_paper_size, pdf_landscape: request.pdf_landscape, long_tables: request.long_tables, + theme: request.theme, }, request.body, options diff --git a/packages/sdk/src/4.0/methodsInterface.ts b/packages/sdk/src/4.0/methodsInterface.ts index d154ef25f..0968052c5 100644 --- a/packages/sdk/src/4.0/methodsInterface.ts +++ b/packages/sdk/src/4.0/methodsInterface.ts @@ -25,7 +25,7 @@ */ /** - * 461 API methods + * 464 API methods */ import type { @@ -237,6 +237,7 @@ import type { ISetting, ISmtpSettings, ISmtpStatus, + ISqlInterfaceQuery, ISqlQuery, ISqlQueryCreate, ISshPublicKey, @@ -307,6 +308,7 @@ import type { IWriteScheduledPlan, IWriteSessionConfig, IWriteSetting, + IWriteSqlInterfaceQueryCreate, IWriteSshServer, IWriteSshTunnel, IWriteTheme, @@ -925,6 +927,20 @@ export interface ILooker40SDK extends IAPIMethods { options?: Partial ): Promise> + /** + * ### Validate a Signed Embed URL + * + * GET /embed/sso/validate -> IEmbedUrlResponse + * + * @param url URL to validate + * @param options one-time API call overrides + * + */ + validate_embed_url( + url?: string, + options?: Partial + ): Promise> + /** * ### Acquire a cookieless embed session. * @@ -2715,7 +2731,10 @@ export interface ILooker40SDK extends IAPIMethods { /** * ### This feature is enabled only by special license. - * ### Gets the whitelabel configuration, which includes hiding documentation links, custom favicon uploading, etc. + * + * This endpoint provides the private label configuration, which includes hiding documentation links, custom favicon uploading, etc. + * + * This endpoint is deprecated. [Get Setting](#!/Config/get_setting) should be used to retrieve private label settings instead * * GET /whitelabel_configuration -> IWhitelabelConfiguration * @@ -2731,7 +2750,9 @@ export interface ILooker40SDK extends IAPIMethods { ): Promise> /** - * ### Update the whitelabel configuration + * ### Update the private label configuration + * + * This endpoint is deprecated. [Set Setting](#!/Config/set_setting) should be used to update private label settings instead * * PUT /whitelabel_configuration -> IWhitelabelConfiguration * @@ -4333,10 +4354,7 @@ export interface ILooker40SDK extends IAPIMethods { /** * ### Get information about all folders. * - * In API 3.x, this will not return empty personal folders, unless they belong to the calling user, - * or if they contain soft-deleted content. - * - * In API 4.0+, all personal folders will be returned. + * All personal folders will be returned. * * GET /folders -> IFolder[] * @@ -4428,7 +4446,6 @@ export interface ILooker40SDK extends IAPIMethods { /** * ### Get all looks in a folder. - * In API 3.x, this will return all looks in a folder, including looks in the trash. * In API 4.0+, all looks in a folder will be returned, excluding looks in the trash. * * GET /folders/{folder_id}/looks -> ILookWithQuery[] @@ -5119,7 +5136,7 @@ export interface ILooker40SDK extends IAPIMethods { * * Soft-deleted looks are excluded from the results of [all_looks()](#!/Look/all_looks) and [search_looks()](#!/Look/search_looks), so they * essentially disappear from view even though they still reside in the db. - * In API 3.1 and later, you can pass `deleted: true` as a parameter to [search_looks()](#!/3.1/Look/search_looks) to list soft-deleted looks. + * You can pass `deleted: true` as a parameter to [search_looks()](#!/Look/search_looks) to list soft-deleted looks. * * NOTE: [delete_look()](#!/Look/delete_look) performs a "hard delete" - the look data is removed from the Looker * database and destroyed. There is no "undo" for `delete_look()`. @@ -5169,7 +5186,8 @@ export interface ILooker40SDK extends IAPIMethods { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -6339,7 +6357,8 @@ export interface ILooker40SDK extends IAPIMethods { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -6405,7 +6424,8 @@ export interface ILooker40SDK extends IAPIMethods { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -6447,7 +6467,7 @@ export interface ILooker40SDK extends IAPIMethods { * Here is an example inline query URL: * * ``` - * https://looker.mycompany.com:19999/api/3.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles + * https://looker.mycompany.com:19999/api/4.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles * ``` * * When invoking this endpoint with the Ruby SDK, pass the query parameter parts as a hash. The hash to match the above would look like: @@ -6473,7 +6493,8 @@ export interface ILooker40SDK extends IAPIMethods { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -6578,18 +6599,64 @@ export interface ILooker40SDK extends IAPIMethods { ): Promise> /** - * Get a SQL Runner query. + * ### Run a saved SQL interface query. * - * GET /sql_queries/{slug} -> ISqlQuery + * This runs a previously created SQL interface query. * - * @param slug slug of query + * The 'result_format' parameter specifies the desired structure and format of the response. + * + * Supported formats: + * + * | result_format | Description + * | :-----------: | :--- | + * | json | Plain json + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | csv | Comma separated values with a header + * | txt | Tab separated values with a header + * | html | Simple html + * | md | Simple markdown + * | xlsx | MS Excel spreadsheet + * | sql | Returns the generated SQL rather than running the query + * | png | A PNG image of the visualization of the query + * | jpg | A JPG image of the visualization of the query + * + * GET /sql_interface_queries/{query_id}/run/{result_format} -> string + * + * @remarks + * **NOTE**: Binary content may be returned by this function. + * + * @param query_id Integer id of query + * @param result_format Format of result, options are: ["json_bi"] * @param options one-time API call overrides * */ - sql_query( - slug: string, + run_sql_interface_query( + query_id: number, + result_format: string, options?: Partial - ): Promise> + ): Promise> + + /** + * ### Create a SQL interface query. + * + * This allows you to create a new SQL interface query that you can later run. Looker queries are immutable once created + * and are not deleted. If you create a query that is exactly like an existing query then the existing query + * will be returned and no new query will be created. Whether a new query is created or not, you can use + * the 'id' in the returned query with the 'run' method. + * + * The query parameters are passed as json in the body of the request. + * + * POST /sql_interface_queries -> ISqlInterfaceQuery + * + * @param body Partial + * @param options one-time API call overrides + * + */ + create_sql_interface_query( + body: Partial, + options?: Partial + ): Promise> /** * ### Create a SQL Runner Query @@ -6607,6 +6674,20 @@ export interface ILooker40SDK extends IAPIMethods { options?: Partial ): Promise> + /** + * Get a SQL Runner query. + * + * GET /sql_queries/{slug} -> ISqlQuery + * + * @param slug slug of query + * @param options one-time API call overrides + * + */ + sql_query( + slug: string, + options?: Partial + ): Promise> + /** * Execute a SQL Runner query in a given result_format. * diff --git a/packages/sdk/src/4.0/models.ts b/packages/sdk/src/4.0/models.ts index 355e02737..fde16dcd5 100644 --- a/packages/sdk/src/4.0/models.ts +++ b/packages/sdk/src/4.0/models.ts @@ -25,7 +25,7 @@ */ /** - * 395 API models: 247 Spec, 66 Request, 60 Write, 22 Enum + * 398 API models: 249 Spec, 66 Request, 61 Write, 22 Enum */ import type { IDictionary, DelimArray } from '@looker/sdk-rtl' @@ -63,7 +63,7 @@ export interface IAlert { */ comparison_type: ComparisonType /** - * Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals + * Vixie-Style crontab specification when to run. At minimum, it has to be longer than 15 minute intervals */ cron: string /** @@ -3023,7 +3023,7 @@ export interface IDialect { */ persistent_table_distkey?: string /** - * Suports streaming results (read-only) + * Supports streaming results (read-only) */ supports_streaming?: boolean /** @@ -4335,11 +4335,11 @@ export interface IIntegrationRequiredField { */ tag?: string | null /** - * If present, supercedes 'tag' and matches a field that has any of the provided tags. (read-only) + * If present, supersedes 'tag' and matches a field that has any of the provided tags. (read-only) */ any_tag?: string[] | null /** - * If present, supercedes 'tag' and matches a field that has all of the provided tags. (read-only) + * If present, supersedes 'tag' and matches a field that has all of the provided tags. (read-only) */ all_tags?: string[] | null } @@ -6733,6 +6733,10 @@ export interface IProject { * Status of dependencies in your manifest & lockfile */ dependency_status?: string | null + /** + * Number of data tests within project (read-only) + */ + data_tests_count?: number } export interface IProjectError { @@ -7717,6 +7721,10 @@ export interface IRequestCreateDashboardRenderTask { * Whether or not to expand table vis to full length */ long_tables?: boolean | null + /** + * Theme to apply. Will render embedded version of dashboard if valid + */ + theme?: string | null } /** @@ -8388,19 +8396,19 @@ export interface IRequestSearchBoards { */ sorts?: string | null /** - * The page to return. DEPRECATED. Use offset instead. + * DEPRECATED. Use limit and offset instead. Return only page N of paginated results */ page?: number | null /** - * The number of items in the returned page. DEPRECATED. Use limit instead. + * DEPRECATED. Use limit and offset instead. Return N rows of data per page */ per_page?: number | null /** - * The number of items to skip before returning any. (used with limit and takes priority over page and per_page) + * Number of results to return. (used with offset and takes priority over page and per_page) */ offset?: number | null /** - * The maximum number of items to return. (used with offset and takes priority over page and per_page) + * Number of results to skip before returning any. (used with limit and takes priority over page and per_page) */ limit?: number | null /** @@ -8438,11 +8446,11 @@ export interface IRequestSearchContent { */ offset?: number | null /** - * Requested page. + * DEPRECATED. Use limit and offset instead. Return only page N of paginated results */ page?: number | null /** - * Results per page. + * DEPRECATED. Use limit and offset instead. Return N rows of data per page */ per_page?: number | null } @@ -8652,7 +8660,7 @@ export interface IRequestSearchDashboards { */ content_favorite_id?: string | null /** - * Filter on a particular space. + * Filter on a particular folder. */ folder_id?: string | null /** @@ -10505,6 +10513,36 @@ export interface ISnippet { sql?: string } +export interface ISqlInterfaceQuery { + /** + * Operations the current user is able to perform on this object (read-only) + */ + can?: IDictionary + /** + * Unique Id (read-only) + */ + id?: number + /** + * Calcite signature (read-only) + */ + signature: string | null +} + +export interface ISqlInterfaceQueryCreate { + /** + * Operations the current user is able to perform on this object (read-only) + */ + can?: IDictionary + /** + * Original SQL request + */ + sql: string | null + /** + * Whether the query should be run for use in a JDBC Client. This changes the formatting of some datetime based values. + */ + jdbc_client?: boolean +} + export interface ISqlQuery { /** * Operations the current user is able to perform on this object (read-only) @@ -11556,7 +11594,7 @@ export interface IWriteAlert { */ comparison_type: ComparisonType | null /** - * Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals + * Vixie-Style crontab specification when to run. At minimum, it has to be longer than 15 minute intervals */ cron: string /** @@ -13163,7 +13201,7 @@ export interface IWritePrivatelabelConfiguration { /** * Dynamic writeable type for Project removes: - * can, id, uses_git, is_example + * can, id, uses_git, is_example, data_tests_count */ export interface IWriteProject { /** @@ -13707,6 +13745,21 @@ export interface IWriteSetting { embed_config?: IEmbedConfig | null } +/** + * Dynamic writeable type for SqlInterfaceQueryCreate removes: + * can + */ +export interface IWriteSqlInterfaceQueryCreate { + /** + * Original SQL request + */ + sql: string | null + /** + * Whether the query should be run for use in a JDBC Client. This changes the formatting of some datetime based values. + */ + jdbc_client?: boolean +} + /** * Dynamic writeable type for SshServer removes: * ssh_server_id, finger_print, sha_finger_print, public_key, status diff --git a/packages/sdk/src/4.0/streams.ts b/packages/sdk/src/4.0/streams.ts index f848f24c9..08cdc07ed 100644 --- a/packages/sdk/src/4.0/streams.ts +++ b/packages/sdk/src/4.0/streams.ts @@ -25,7 +25,7 @@ */ /** - * 461 API methods + * 464 API methods */ import type { Readable } from 'readable-stream' @@ -239,6 +239,7 @@ import type { ISetting, ISmtpSettings, ISmtpStatus, + ISqlInterfaceQuery, ISqlQuery, ISqlQueryCreate, ISshPublicKey, @@ -309,6 +310,7 @@ import type { IWriteScheduledPlan, IWriteSessionConfig, IWriteSetting, + IWriteSqlInterfaceQueryCreate, IWriteSshServer, IWriteSshTunnel, IWriteTheme, @@ -1263,6 +1265,31 @@ export class Looker40SDKStream extends APIMethods { ) } + /** + * ### Validate a Signed Embed URL + * + * GET /embed/sso/validate -> IEmbedUrlResponse + * + * @param callback streaming output function + * @param url URL to validate + * @param options one-time API call overrides + * + */ + async validate_embed_url( + callback: (readable: Readable) => Promise, + url?: string, + options?: Partial + ) { + return this.authStream( + callback, + 'GET', + '/embed/sso/validate', + { url }, + null, + options + ) + } + /** * ### Acquire a cookieless embed session. * @@ -4164,7 +4191,10 @@ export class Looker40SDKStream extends APIMethods { /** * ### This feature is enabled only by special license. - * ### Gets the whitelabel configuration, which includes hiding documentation links, custom favicon uploading, etc. + * + * This endpoint provides the private label configuration, which includes hiding documentation links, custom favicon uploading, etc. + * + * This endpoint is deprecated. [Get Setting](#!/Config/get_setting) should be used to retrieve private label settings instead * * GET /whitelabel_configuration -> IWhitelabelConfiguration * @@ -4191,7 +4221,9 @@ export class Looker40SDKStream extends APIMethods { } /** - * ### Update the whitelabel configuration + * ### Update the private label configuration + * + * This endpoint is deprecated. [Set Setting](#!/Config/set_setting) should be used to update private label settings instead * * PUT /whitelabel_configuration -> IWhitelabelConfiguration * @@ -6917,10 +6949,7 @@ export class Looker40SDKStream extends APIMethods { /** * ### Get information about all folders. * - * In API 3.x, this will not return empty personal folders, unless they belong to the calling user, - * or if they contain soft-deleted content. - * - * In API 4.0+, all personal folders will be returned. + * All personal folders will be returned. * * GET /folders -> IFolder[] * @@ -7089,7 +7118,6 @@ export class Looker40SDKStream extends APIMethods { /** * ### Get all looks in a folder. - * In API 3.x, this will return all looks in a folder, including looks in the trash. * In API 4.0+, all looks in a folder will be returned, excluding looks in the trash. * * GET /folders/{folder_id}/looks -> ILookWithQuery[] @@ -8263,7 +8291,7 @@ export class Looker40SDKStream extends APIMethods { * * Soft-deleted looks are excluded from the results of [all_looks()](#!/Look/all_looks) and [search_looks()](#!/Look/search_looks), so they * essentially disappear from view even though they still reside in the db. - * In API 3.1 and later, you can pass `deleted: true` as a parameter to [search_looks()](#!/3.1/Look/search_looks) to list soft-deleted looks. + * You can pass `deleted: true` as a parameter to [search_looks()](#!/Look/search_looks) to list soft-deleted looks. * * NOTE: [delete_look()](#!/Look/delete_look) performs a "hard delete" - the look data is removed from the Looker * database and destroyed. There is no "undo" for `delete_look()`. @@ -8337,7 +8365,8 @@ export class Looker40SDKStream extends APIMethods { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -10233,7 +10262,8 @@ export class Looker40SDKStream extends APIMethods { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -10326,7 +10356,8 @@ export class Looker40SDKStream extends APIMethods { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -10393,7 +10424,7 @@ export class Looker40SDKStream extends APIMethods { * Here is an example inline query URL: * * ``` - * https://looker.mycompany.com:19999/api/3.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles + * https://looker.mycompany.com:19999/api/4.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles * ``` * * When invoking this endpoint with the Ruby SDK, pass the query parameter parts as a hash. The hash to match the above would look like: @@ -10419,7 +10450,8 @@ export class Looker40SDKStream extends APIMethods { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -10584,31 +10616,88 @@ export class Looker40SDKStream extends APIMethods { } /** - * Get a SQL Runner query. + * ### Run a saved SQL interface query. * - * GET /sql_queries/{slug} -> ISqlQuery + * This runs a previously created SQL interface query. + * + * The 'result_format' parameter specifies the desired structure and format of the response. + * + * Supported formats: + * + * | result_format | Description + * | :-----------: | :--- | + * | json | Plain json + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | csv | Comma separated values with a header + * | txt | Tab separated values with a header + * | html | Simple html + * | md | Simple markdown + * | xlsx | MS Excel spreadsheet + * | sql | Returns the generated SQL rather than running the query + * | png | A PNG image of the visualization of the query + * | jpg | A JPG image of the visualization of the query + * + * GET /sql_interface_queries/{query_id}/run/{result_format} -> string + * + * @remarks + * **NOTE**: Binary content may be returned by this function. * * @param callback streaming output function - * @param slug slug of query + * @param query_id Integer id of query + * @param result_format Format of result, options are: ["json_bi"] * @param options one-time API call overrides * */ - async sql_query( - callback: (readable: Readable) => Promise, - slug: string, + async run_sql_interface_query( + callback: (readable: Readable) => Promise, + query_id: number, + result_format: string, options?: Partial ) { - slug = encodeParam(slug) - return this.authStream( + result_format = encodeParam(result_format) + return this.authStream( callback, 'GET', - `/sql_queries/${slug}`, + `/sql_interface_queries/${query_id}/run/${result_format}`, null, null, options ) } + /** + * ### Create a SQL interface query. + * + * This allows you to create a new SQL interface query that you can later run. Looker queries are immutable once created + * and are not deleted. If you create a query that is exactly like an existing query then the existing query + * will be returned and no new query will be created. Whether a new query is created or not, you can use + * the 'id' in the returned query with the 'run' method. + * + * The query parameters are passed as json in the body of the request. + * + * POST /sql_interface_queries -> ISqlInterfaceQuery + * + * @param callback streaming output function + * @param body Partial + * @param options one-time API call overrides + * + */ + async create_sql_interface_query( + callback: (readable: Readable) => Promise, + body: Partial, + options?: Partial + ) { + return this.authStream( + callback, + 'POST', + '/sql_interface_queries', + null, + body, + options + ) + } + /** * ### Create a SQL Runner Query * @@ -10636,6 +10725,32 @@ export class Looker40SDKStream extends APIMethods { ) } + /** + * Get a SQL Runner query. + * + * GET /sql_queries/{slug} -> ISqlQuery + * + * @param callback streaming output function + * @param slug slug of query + * @param options one-time API call overrides + * + */ + async sql_query( + callback: (readable: Readable) => Promise, + slug: string, + options?: Partial + ) { + slug = encodeParam(slug) + return this.authStream( + callback, + 'GET', + `/sql_queries/${slug}`, + null, + null, + options + ) + } + /** * Execute a SQL Runner query in a given result_format. * @@ -10784,6 +10899,7 @@ export class Looker40SDKStream extends APIMethods { pdf_paper_size: request.pdf_paper_size, pdf_landscape: request.pdf_landscape, long_tables: request.long_tables, + theme: request.theme, }, request.body, options diff --git a/packages/sdk/src/constants.ts b/packages/sdk/src/constants.ts index b84c8de8f..8ee14485d 100644 --- a/packages/sdk/src/constants.ts +++ b/packages/sdk/src/constants.ts @@ -24,5 +24,5 @@ */ -export const sdkVersion = '23.14' +export const sdkVersion = '23.17' export const environmentPrefix = 'LOOKERSDK' diff --git a/python/looker_sdk/sdk/api40/methods.py b/python/looker_sdk/sdk/api40/methods.py index 65b0f9a01..a2ad03e2b 100644 --- a/python/looker_sdk/sdk/api40/methods.py +++ b/python/looker_sdk/sdk/api40/methods.py @@ -21,7 +21,7 @@ # SOFTWARE. # -# 461 API methods +# 464 API methods # NOTE: Do not edit this file generated by Looker SDK Codegen for API 4.0 @@ -876,6 +876,27 @@ def create_embed_url_as_me( ) return response + # ### Validate a Signed Embed URL + # + # GET /embed/sso/validate -> mdls.EmbedUrlResponse + def validate_embed_url( + self, + # URL to validate + url: Optional[str] = None, + transport_options: Optional[transport.TransportOptions] = None, + ) -> mdls.EmbedUrlResponse: + """Get Embed URL Validation""" + response = cast( + mdls.EmbedUrlResponse, + self.get( + path="/embed/sso/validate", + structure=mdls.EmbedUrlResponse, + query_params={"url": url}, + transport_options=transport_options + ) + ) + return response + # ### Acquire a cookieless embed session. # # The acquire session endpoint negates the need for signing the embed url and passing it as a parameter @@ -2205,13 +2226,13 @@ def search_boards( creator_id: Optional[str] = None, # The fields to sort the results by sorts: Optional[str] = None, - # The page to return. DEPRECATED. Use offset instead. + # DEPRECATED. Use limit and offset instead. Return only page N of paginated results page: Optional[int] = None, - # The number of items in the returned page. DEPRECATED. Use limit instead. + # DEPRECATED. Use limit and offset instead. Return N rows of data per page per_page: Optional[int] = None, - # The number of items to skip before returning any. (used with limit and takes priority over page and per_page) + # Number of results to return. (used with offset and takes priority over page and per_page) offset: Optional[int] = None, - # The maximum number of items to return. (used with offset and takes priority over page and per_page) + # Number of results to skip before returning any. (used with limit and takes priority over page and per_page) limit: Optional[int] = None, # Combine given search criteria in a boolean OR expression filter_or: Optional[bool] = None, @@ -3341,7 +3362,10 @@ def api_spec( return response # ### This feature is enabled only by special license. - # ### Gets the whitelabel configuration, which includes hiding documentation links, custom favicon uploading, etc. + # + # This endpoint provides the private label configuration, which includes hiding documentation links, custom favicon uploading, etc. + # + # This endpoint is deprecated. [Get Setting](#!/Config/get_setting) should be used to retrieve private label settings instead # # GET /whitelabel_configuration -> mdls.WhitelabelConfiguration def whitelabel_configuration( @@ -3350,7 +3374,7 @@ def whitelabel_configuration( fields: Optional[str] = None, transport_options: Optional[transport.TransportOptions] = None, ) -> mdls.WhitelabelConfiguration: - """Get Whitelabel configuration""" + """Get Private label configuration""" response = cast( mdls.WhitelabelConfiguration, self.get( @@ -3362,7 +3386,9 @@ def whitelabel_configuration( ) return response - # ### Update the whitelabel configuration + # ### Update the private label configuration + # + # This endpoint is deprecated. [Set Setting](#!/Config/set_setting) should be used to update private label settings instead # # PUT /whitelabel_configuration -> mdls.WhitelabelConfiguration def update_whitelabel_configuration( @@ -3370,7 +3396,7 @@ def update_whitelabel_configuration( body: mdls.WriteWhitelabelConfiguration, transport_options: Optional[transport.TransportOptions] = None, ) -> mdls.WhitelabelConfiguration: - """Update Whitelabel configuration""" + """Update Private label configuration""" response = cast( mdls.WhitelabelConfiguration, self.put( @@ -4258,9 +4284,9 @@ def search_content( limit: Optional[int] = None, # Number of results to skip before returning any. (used with limit and takes priority over page and per_page) offset: Optional[int] = None, - # Requested page. + # DEPRECATED. Use limit and offset instead. Return only page N of paginated results page: Optional[int] = None, - # Results per page. + # DEPRECATED. Use limit and offset instead. Return N rows of data per page per_page: Optional[int] = None, transport_options: Optional[transport.TransportOptions] = None, ) -> Sequence[mdls.ContentSearch]: @@ -4545,7 +4571,7 @@ def search_dashboards( description: Optional[str] = None, # Filter on a content favorite id. content_favorite_id: Optional[str] = None, - # Filter on a particular space. + # Filter on a particular folder. folder_id: Optional[str] = None, # Filter on dashboards deleted status. deleted: Optional[str] = None, @@ -5763,10 +5789,7 @@ def delete_folder( # ### Get information about all folders. # - # In API 3.x, this will not return empty personal folders, unless they belong to the calling user, - # or if they contain soft-deleted content. - # - # In API 4.0+, all personal folders will be returned. + # All personal folders will be returned. # # GET /folders -> Sequence[mdls.Folder] def all_folders( @@ -5921,7 +5944,6 @@ def folder_ancestors( return response # ### Get all looks in a folder. - # In API 3.x, this will return all looks in a folder, including looks in the trash. # In API 4.0+, all looks in a folder will be returned, excluding looks in the trash. # # GET /folders/{folder_id}/looks -> Sequence[mdls.LookWithQuery] @@ -6993,7 +7015,7 @@ def look( # # Soft-deleted looks are excluded from the results of [all_looks()](#!/Look/all_looks) and [search_looks()](#!/Look/search_looks), so they # essentially disappear from view even though they still reside in the db. - # In API 3.1 and later, you can pass `deleted: true` as a parameter to [search_looks()](#!/3.1/Look/search_looks) to list soft-deleted looks. + # You can pass `deleted: true` as a parameter to [search_looks()](#!/Look/search_looks) to list soft-deleted looks. # # NOTE: [delete_look()](#!/Look/delete_look) performs a "hard delete" - the look data is removed from the Looker # database and destroyed. There is no "undo" for `delete_look()`. @@ -7058,7 +7080,8 @@ def delete_look( # | result_format | Description # | :-----------: | :--- | # | json | Plain json - # | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + # | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + # | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query # | csv | Comma separated values with a header # | txt | Tab separated values with a header # | html | Simple html @@ -8776,7 +8799,8 @@ def create_query( # | result_format | Description # | :-----------: | :--- | # | json | Plain json - # | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + # | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + # | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query # | csv | Comma separated values with a header # | txt | Tab separated values with a header # | html | Simple html @@ -8876,7 +8900,8 @@ def run_query( # | result_format | Description # | :-----------: | :--- | # | json | Plain json - # | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + # | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + # | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query # | csv | Comma separated values with a header # | txt | Tab separated values with a header # | html | Simple html @@ -8949,7 +8974,7 @@ def run_inline_query( # Here is an example inline query URL: # # ``` - # https://looker.mycompany.com:19999/api/3.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles + # https://looker.mycompany.com:19999/api/4.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles # ``` # # When invoking this endpoint with the Ruby SDK, pass the query parameter parts as a hash. The hash to match the above would look like: @@ -8975,7 +9000,8 @@ def run_inline_query( # | result_format | Description # | :-----------: | :--- | # | json | Plain json - # | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + # | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + # | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query # | csv | Comma separated values with a header # | txt | Tab separated values with a header # | html | Simple html @@ -9114,22 +9140,71 @@ def kill_query( ) return response - # Get a SQL Runner query. + # ### Run a saved SQL interface query. # - # GET /sql_queries/{slug} -> mdls.SqlQuery - def sql_query( + # This runs a previously created SQL interface query. + # + # The 'result_format' parameter specifies the desired structure and format of the response. + # + # Supported formats: + # + # | result_format | Description + # | :-----------: | :--- | + # | json | Plain json + # | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + # | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + # | csv | Comma separated values with a header + # | txt | Tab separated values with a header + # | html | Simple html + # | md | Simple markdown + # | xlsx | MS Excel spreadsheet + # | sql | Returns the generated SQL rather than running the query + # | png | A PNG image of the visualization of the query + # | jpg | A JPG image of the visualization of the query + # + # GET /sql_interface_queries/{query_id}/run/{result_format} -> Union[str, bytes] + def run_sql_interface_query( self, - # slug of query - slug: str, + # Integer id of query + query_id: int, + # Format of result, options are: ["json_bi"] + result_format: str, transport_options: Optional[transport.TransportOptions] = None, - ) -> mdls.SqlQuery: - """Get SQL Runner Query""" - slug = self.encode_path_param(slug) + ) -> Union[str, bytes]: + """Run SQL Interface Query""" + result_format = self.encode_path_param(result_format) response = cast( - mdls.SqlQuery, + Union[str, bytes], self.get( - path=f"/sql_queries/{slug}", - structure=mdls.SqlQuery, + path=f"/sql_interface_queries/{query_id}/run/{result_format}", + structure=Union[str, bytes], # type: ignore + transport_options=transport_options + ) + ) + return response + + # ### Create a SQL interface query. + # + # This allows you to create a new SQL interface query that you can later run. Looker queries are immutable once created + # and are not deleted. If you create a query that is exactly like an existing query then the existing query + # will be returned and no new query will be created. Whether a new query is created or not, you can use + # the 'id' in the returned query with the 'run' method. + # + # The query parameters are passed as json in the body of the request. + # + # POST /sql_interface_queries -> mdls.SqlInterfaceQuery + def create_sql_interface_query( + self, + body: mdls.WriteSqlInterfaceQueryCreate, + transport_options: Optional[transport.TransportOptions] = None, + ) -> mdls.SqlInterfaceQuery: + """Create SQL Interface Query""" + response = cast( + mdls.SqlInterfaceQuery, + self.post( + path="/sql_interface_queries", + structure=mdls.SqlInterfaceQuery, + body=body, transport_options=transport_options ) ) @@ -9157,6 +9232,27 @@ def create_sql_query( ) return response + # Get a SQL Runner query. + # + # GET /sql_queries/{slug} -> mdls.SqlQuery + def sql_query( + self, + # slug of query + slug: str, + transport_options: Optional[transport.TransportOptions] = None, + ) -> mdls.SqlQuery: + """Get SQL Runner Query""" + slug = self.encode_path_param(slug) + response = cast( + mdls.SqlQuery, + self.get( + path=f"/sql_queries/{slug}", + structure=mdls.SqlQuery, + transport_options=transport_options + ) + ) + return response + # Execute a SQL Runner query in a given result_format. # # POST /sql_queries/{slug}/run/{result_format} -> Union[str, bytes] @@ -9284,6 +9380,8 @@ def create_dashboard_render_task( pdf_landscape: Optional[bool] = None, # Whether or not to expand table vis to full length long_tables: Optional[bool] = None, + # Theme to apply. Will render embedded version of dashboard if valid + theme: Optional[str] = None, transport_options: Optional[transport.TransportOptions] = None, ) -> mdls.RenderTask: """Create Dashboard Render Task""" @@ -9294,7 +9392,7 @@ def create_dashboard_render_task( self.post( path=f"/render_tasks/dashboards/{dashboard_id}/{result_format}", structure=mdls.RenderTask, - query_params={"width": width, "height": height, "fields": fields, "pdf_paper_size": pdf_paper_size, "pdf_landscape": pdf_landscape, "long_tables": long_tables}, + query_params={"width": width, "height": height, "fields": fields, "pdf_paper_size": pdf_paper_size, "pdf_landscape": pdf_landscape, "long_tables": long_tables, "theme": theme}, body=body, transport_options=transport_options ) diff --git a/python/looker_sdk/sdk/api40/models.py b/python/looker_sdk/sdk/api40/models.py index 97f8e7d32..bb5c699b3 100644 --- a/python/looker_sdk/sdk/api40/models.py +++ b/python/looker_sdk/sdk/api40/models.py @@ -21,7 +21,7 @@ # SOFTWARE. # -# 329 API models: 247 Spec, 0 Request, 60 Write, 22 Enum +# 332 API models: 249 Spec, 0 Request, 61 Write, 22 Enum # NOTE: Do not edit this file generated by Looker SDK Codegen for API 4.0 @@ -73,7 +73,7 @@ class Alert(model.Model): """ Attributes: comparison_type: This property informs the check what kind of comparison we are performing. Only certain condition types are valid for time series alerts. For details, refer to [Setting Alert Conditions](https://cloud.google.com/looker/docs/sharing-and-publishing/creating-alerts#setting_alert_conditions) Valid values are: "EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL_TO", "LESS_THAN", "LESS_THAN_OR_EQUAL_TO", "INCREASES_BY", "DECREASES_BY", "CHANGES_BY". - cron: Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals + cron: Vixie-Style crontab specification when to run. At minimum, it has to be longer than 15 minute intervals destinations: Array of destinations to send alerts to. Must be the same type of destination. Example `[{ "destination_type": "EMAIL", "email_address": "test@test.com" }]` field: owner_id: User id of alert owner @@ -3702,7 +3702,7 @@ class Dialect(model.Model): persistent_table_indexes: PDT index columns persistent_table_sortkeys: PDT sortkey columns persistent_table_distkey: PDT distkey column - supports_streaming: Suports streaming results + supports_streaming: Supports streaming results automatically_run_sql_runner_snippets: Should SQL Runner snippets automatically be run connection_tests: Array of names of the tests that can be run on a connection using this dialect supports_inducer: Is supported with the inducer (i.e. generate from sql) @@ -5255,8 +5255,8 @@ class IntegrationRequiredField(model.Model): """ Attributes: tag: Matches a field that has this tag. - any_tag: If present, supercedes 'tag' and matches a field that has any of the provided tags. - all_tags: If present, supercedes 'tag' and matches a field that has all of the provided tags. + any_tag: If present, supersedes 'tag' and matches a field that has any of the provided tags. + all_tags: If present, supersedes 'tag' and matches a field that has all of the provided tags. """ tag: Optional[str] = None any_tag: Optional[Sequence[str]] = None @@ -8052,6 +8052,7 @@ class Project(model.Model): allow_warnings: Validation policy: If true, the project can be committed with warnings when `validation_required` is true. (`allow_warnings` does nothing if `validation_required` is false). is_example: If true the project is an example project and cannot be modified dependency_status: Status of dependencies in your manifest & lockfile + data_tests_count: Number of data tests within project """ can: Optional[MutableMapping[str, bool]] = None id: Optional[str] = None @@ -8075,6 +8076,7 @@ class Project(model.Model): allow_warnings: Optional[bool] = None is_example: Optional[bool] = None dependency_status: Optional[str] = None + data_tests_count: Optional[int] = None def __init__(self, *, can: Optional[MutableMapping[str, bool]] = None, @@ -8098,7 +8100,8 @@ def __init__(self, *, git_release_mgmt_enabled: Optional[bool] = None, allow_warnings: Optional[bool] = None, is_example: Optional[bool] = None, - dependency_status: Optional[str] = None): + dependency_status: Optional[str] = None, + data_tests_count: Optional[int] = None): self.can = can self.id = id self.name = name @@ -8121,6 +8124,7 @@ def __init__(self, *, self.allow_warnings = allow_warnings self.is_example = is_example self.dependency_status = dependency_status + self.data_tests_count = data_tests_count @attr.s(auto_attribs=True, init=False) @@ -9912,6 +9916,48 @@ def __init__(self, *, self.sql = sql +@attr.s(auto_attribs=True, init=False) +class SqlInterfaceQuery(model.Model): + """ + Attributes: + signature: Calcite signature + can: Operations the current user is able to perform on this object + id: Unique Id + """ + signature: str + can: Optional[MutableMapping[str, bool]] = None + id: Optional[int] = None + + def __init__(self, *, + signature: str, + can: Optional[MutableMapping[str, bool]] = None, + id: Optional[int] = None): + self.signature = signature + self.can = can + self.id = id + + +@attr.s(auto_attribs=True, init=False) +class SqlInterfaceQueryCreate(model.Model): + """ + Attributes: + sql: Original SQL request + can: Operations the current user is able to perform on this object + jdbc_client: Whether the query should be run for use in a JDBC Client. This changes the formatting of some datetime based values. + """ + sql: str + can: Optional[MutableMapping[str, bool]] = None + jdbc_client: Optional[bool] = None + + def __init__(self, *, + sql: str, + can: Optional[MutableMapping[str, bool]] = None, + jdbc_client: Optional[bool] = None): + self.sql = sql + self.can = can + self.jdbc_client = jdbc_client + + @attr.s(auto_attribs=True, init=False) class SqlQuery(model.Model): """ @@ -11190,7 +11236,7 @@ class WriteAlert(model.Model): Attributes: comparison_type: This property informs the check what kind of comparison we are performing. Only certain condition types are valid for time series alerts. For details, refer to [Setting Alert Conditions](https://cloud.google.com/looker/docs/sharing-and-publishing/creating-alerts#setting_alert_conditions) Valid values are: "EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL_TO", "LESS_THAN", "LESS_THAN_OR_EQUAL_TO", "INCREASES_BY", "DECREASES_BY", "CHANGES_BY". - cron: Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals + cron: Vixie-Style crontab specification when to run. At minimum, it has to be longer than 15 minute intervals destinations: Array of destinations to send alerts to. Must be the same type of destination. Example `[{ "destination_type": "EMAIL", "email_address": "test@test.com" }]` field: owner_id: User id of alert owner @@ -13076,7 +13122,7 @@ def __init__(self, *, class WriteProject(model.Model): """ Dynamic writeable type for Project removes: -can, id, uses_git, is_example +can, id, uses_git, is_example, data_tests_count Attributes: name: Project display name @@ -13672,6 +13718,26 @@ def __init__(self, *, self.embed_config = embed_config +@attr.s(auto_attribs=True, init=False) +class WriteSqlInterfaceQueryCreate(model.Model): + """ + Dynamic writeable type for SqlInterfaceQueryCreate removes: +can + + Attributes: + sql: Original SQL request + jdbc_client: Whether the query should be run for use in a JDBC Client. This changes the formatting of some datetime based values. + """ + sql: str + jdbc_client: Optional[bool] = None + + def __init__(self, *, + sql: str, + jdbc_client: Optional[bool] = None): + self.sql = sql + self.jdbc_client = jdbc_client + + @attr.s(auto_attribs=True, init=False) class WriteSshServer(model.Model): """ diff --git a/python/looker_sdk/sdk/constants.py b/python/looker_sdk/sdk/constants.py index 58095a2f3..2ae277135 100644 --- a/python/looker_sdk/sdk/constants.py +++ b/python/looker_sdk/sdk/constants.py @@ -20,5 +20,5 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -sdk_version = "23.14" +sdk_version = "23.17" environment_prefix = "LOOKERSDK" diff --git a/spec/Looker.4.0.json b/spec/Looker.4.0.json index bce241737..f4512a4ed 100644 --- a/spec/Looker.4.0.json +++ b/spec/Looker.4.0.json @@ -1,8 +1,8 @@ { "swagger": "2.0", "info": { - "version": "4.0.23.14", - "x-looker-release-version": "23.14.9", + "version": "4.0.23.17", + "x-looker-release-version": "23.17.75", "title": "Looker API 4.0 Reference", "description": "\nAPI 4.0 is the current release of the Looker API. API 3.1 is deprecated.\n\n### Authorization\n\nThe classic method of API authorization uses Looker **API** credentials for authorization and access control.\nLooker admins can create API credentials on Looker's **Admin/Users** page.\n\nAPI 4.0 adds additional ways to authenticate API requests, including OAuth and CORS requests.\n\nFor details, see [Looker API Authorization](https://cloud.google.com/looker/docs/r/api/authorization).\n\n\n### API Explorer\n\nThe API Explorer is a Looker-provided utility with many new and unique features for learning and using the Looker API and SDKs.\n\nFor details, see the [API Explorer documentation](https://cloud.google.com/looker/docs/r/api/explorer).\n\n\n### Looker Language SDKs\n\nThe Looker API is a RESTful system that should be usable by any programming language capable of making\nHTTPS requests. SDKs for a variety of programming languages are also provided to streamline using the API. Looker\nhas an OpenSource [sdk-codegen project](https://github.com/looker-open-source/sdk-codegen) that provides several\nlanguage SDKs. Language SDKs generated by `sdk-codegen` have an Authentication manager that can automatically\nauthenticate API requests when needed.\n\nFor details on available Looker SDKs, see [Looker API Client SDKs](https://cloud.google.com/looker/docs/r/api/client_sdks).\n\n\n### API Versioning\n\nFuture releases of Looker expand the latest API version release-by-release to securely expose more and more of the core\npower of the Looker platform to API client applications. API endpoints marked as \"beta\" may receive breaking changes without\nwarning (but we will try to avoid doing that). Stable (non-beta) API endpoints should not receive breaking\nchanges in future releases.\n\nFor details, see [Looker API Versioning](https://cloud.google.com/looker/docs/r/api/versioning).\n\n\n### In This Release\n\nAPI 4.0 version was introduced to make adjustments to API functions, parameters, and response types to\nfix bugs and inconsistencies. These changes fall outside the bounds of non-breaking additive changes we can\nmake to the previous API 3.1.\n\nOne benefit of these type adjustments in API 4.0 is dramatically better support for strongly\ntyped languages like TypeScript, Kotlin, Swift, Go, C#, and more.\n\nSee the [API 4.0 GA announcement](https://developers.looker.com/api/advanced-usage/version-4-ga) for more information\nabout API 4.0.\n\nThe API Explorer can be used to [interactively compare](https://cloud.google.com/looker/docs/r/api/explorer#comparing_api_versions) the differences between API 3.1 and 4.0.\n\n\n### API and SDK Support Policies\n\nLooker API versions and language SDKs have varying support levels. Please read the API and SDK\n[support policies](https://cloud.google.com/looker/docs/r/api/support-policy) for more information.\n\n\n", "contact": { @@ -11,7 +11,7 @@ }, "license": { "name": "EULA", - "url": "https://localhost:10000/eula" + "url": "https://gcplmaster.dev.looker.com/eula" } }, "basePath": "/api/4.0", @@ -21,7 +21,7 @@ "produces": [ "application/json" ], - "host": "localhost:20000", + "host": "gcplmaster.dev.looker.com:443", "schemes": [ "https" ], @@ -628,7 +628,7 @@ ], "operationId": "run_query", "summary": "Run Query", - "description": "### Run a saved query.\n\nThis runs a previously saved query. You can use this on a query that was generated in the Looker UI\nor one that you have explicitly created using the API. You can also use a query 'id' from a saved 'Look'.\n\nThe 'result_format' parameter specifies the desired structure and format of the response.\n\nSupported formats:\n\n| result_format | Description\n| :-----------: | :--- |\n| json | Plain json\n| json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| csv | Comma separated values with a header\n| txt | Tab separated values with a header\n| html | Simple html\n| md | Simple markdown\n| xlsx | MS Excel spreadsheet\n| sql | Returns the generated SQL rather than running the query\n| png | A PNG image of the visualization of the query\n| jpg | A JPG image of the visualization of the query\n\n\n", + "description": "### Run a saved query.\n\nThis runs a previously saved query. You can use this on a query that was generated in the Looker UI\nor one that you have explicitly created using the API. You can also use a query 'id' from a saved 'Look'.\n\nThe 'result_format' parameter specifies the desired structure and format of the response.\n\nSupported formats:\n\n| result_format | Description\n| :-----------: | :--- |\n| json | Plain json\n| json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| csv | Comma separated values with a header\n| txt | Tab separated values with a header\n| html | Simple html\n| md | Simple markdown\n| xlsx | MS Excel spreadsheet\n| sql | Returns the generated SQL rather than running the query\n| png | A PNG image of the visualization of the query\n| jpg | A JPG image of the visualization of the query\n\n\n", "produces": [ "text", "application/json", @@ -788,7 +788,7 @@ ], "operationId": "run_inline_query", "summary": "Run Inline Query", - "description": "### Run the query that is specified inline in the posted body.\n\nThis allows running a query as defined in json in the posted body. This combines\nthe two actions of posting & running a query into one step.\n\nHere is an example body in json:\n```\n{\n \"model\":\"thelook\",\n \"view\":\"inventory_items\",\n \"fields\":[\"category.name\",\"inventory_items.days_in_inventory_tier\",\"products.count\"],\n \"filters\":{\"category.name\":\"socks\"},\n \"sorts\":[\"products.count desc 0\"],\n \"limit\":\"500\",\n \"query_timezone\":\"America/Los_Angeles\"\n}\n```\n\nWhen using the Ruby SDK this would be passed as a Ruby hash like:\n```\n{\n :model=>\"thelook\",\n :view=>\"inventory_items\",\n :fields=>\n [\"category.name\",\n \"inventory_items.days_in_inventory_tier\",\n \"products.count\"],\n :filters=>{:\"category.name\"=>\"socks\"},\n :sorts=>[\"products.count desc 0\"],\n :limit=>\"500\",\n :query_timezone=>\"America/Los_Angeles\",\n}\n```\n\nThis will return the result of running the query in the format specified by the 'result_format' parameter.\n\nSupported formats:\n\n| result_format | Description\n| :-----------: | :--- |\n| json | Plain json\n| json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| csv | Comma separated values with a header\n| txt | Tab separated values with a header\n| html | Simple html\n| md | Simple markdown\n| xlsx | MS Excel spreadsheet\n| sql | Returns the generated SQL rather than running the query\n| png | A PNG image of the visualization of the query\n| jpg | A JPG image of the visualization of the query\n\n\n", + "description": "### Run the query that is specified inline in the posted body.\n\nThis allows running a query as defined in json in the posted body. This combines\nthe two actions of posting & running a query into one step.\n\nHere is an example body in json:\n```\n{\n \"model\":\"thelook\",\n \"view\":\"inventory_items\",\n \"fields\":[\"category.name\",\"inventory_items.days_in_inventory_tier\",\"products.count\"],\n \"filters\":{\"category.name\":\"socks\"},\n \"sorts\":[\"products.count desc 0\"],\n \"limit\":\"500\",\n \"query_timezone\":\"America/Los_Angeles\"\n}\n```\n\nWhen using the Ruby SDK this would be passed as a Ruby hash like:\n```\n{\n :model=>\"thelook\",\n :view=>\"inventory_items\",\n :fields=>\n [\"category.name\",\n \"inventory_items.days_in_inventory_tier\",\n \"products.count\"],\n :filters=>{:\"category.name\"=>\"socks\"},\n :sorts=>[\"products.count desc 0\"],\n :limit=>\"500\",\n :query_timezone=>\"America/Los_Angeles\",\n}\n```\n\nThis will return the result of running the query in the format specified by the 'result_format' parameter.\n\nSupported formats:\n\n| result_format | Description\n| :-----------: | :--- |\n| json | Plain json\n| json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| csv | Comma separated values with a header\n| txt | Tab separated values with a header\n| html | Simple html\n| md | Simple markdown\n| xlsx | MS Excel spreadsheet\n| sql | Returns the generated SQL rather than running the query\n| png | A PNG image of the visualization of the query\n| jpg | A JPG image of the visualization of the query\n\n\n", "produces": [ "text", "application/json", @@ -943,7 +943,7 @@ ], "operationId": "run_url_encoded_query", "summary": "Run Url Encoded Query", - "description": "### Run an URL encoded query.\n\nThis requires the caller to encode the specifiers for the query into the URL query part using\nLooker-specific syntax as explained below.\n\nGenerally, you would want to use one of the methods that takes the parameters as json in the POST body\nfor creating and/or running queries. This method exists for cases where one really needs to encode the\nparameters into the URL of a single 'GET' request. This matches the way that the Looker UI formats\n'explore' URLs etc.\n\nThe parameters here are very similar to the json body formatting except that the filter syntax is\ntricky. Unfortunately, this format makes this method not currently callable via the 'Try it out!' button\nin this documentation page. But, this is callable when creating URLs manually or when using the Looker SDK.\n\nHere is an example inline query URL:\n\n```\nhttps://looker.mycompany.com:19999/api/3.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles\n```\n\nWhen invoking this endpoint with the Ruby SDK, pass the query parameter parts as a hash. The hash to match the above would look like:\n\n```ruby\nquery_params =\n{\n fields: \"category.name,inventory_items.days_in_inventory_tier,products.count\",\n :\"f[category.name]\" => \"socks\",\n sorts: \"products.count desc 0\",\n limit: \"500\",\n query_timezone: \"America/Los_Angeles\"\n}\nresponse = ruby_sdk.run_url_encoded_query('thelook','inventory_items','json', query_params)\n\n```\n\nAgain, it is generally easier to use the variant of this method that passes the full query in the POST body.\nThis method is available for cases where other alternatives won't fit the need.\n\nSupported formats:\n\n| result_format | Description\n| :-----------: | :--- |\n| json | Plain json\n| json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| csv | Comma separated values with a header\n| txt | Tab separated values with a header\n| html | Simple html\n| md | Simple markdown\n| xlsx | MS Excel spreadsheet\n| sql | Returns the generated SQL rather than running the query\n| png | A PNG image of the visualization of the query\n| jpg | A JPG image of the visualization of the query\n\n\n", + "description": "### Run an URL encoded query.\n\nThis requires the caller to encode the specifiers for the query into the URL query part using\nLooker-specific syntax as explained below.\n\nGenerally, you would want to use one of the methods that takes the parameters as json in the POST body\nfor creating and/or running queries. This method exists for cases where one really needs to encode the\nparameters into the URL of a single 'GET' request. This matches the way that the Looker UI formats\n'explore' URLs etc.\n\nThe parameters here are very similar to the json body formatting except that the filter syntax is\ntricky. Unfortunately, this format makes this method not currently callable via the 'Try it out!' button\nin this documentation page. But, this is callable when creating URLs manually or when using the Looker SDK.\n\nHere is an example inline query URL:\n\n```\nhttps://looker.mycompany.com:19999/api/4.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles\n```\n\nWhen invoking this endpoint with the Ruby SDK, pass the query parameter parts as a hash. The hash to match the above would look like:\n\n```ruby\nquery_params =\n{\n fields: \"category.name,inventory_items.days_in_inventory_tier,products.count\",\n :\"f[category.name]\" => \"socks\",\n sorts: \"products.count desc 0\",\n limit: \"500\",\n query_timezone: \"America/Los_Angeles\"\n}\nresponse = ruby_sdk.run_url_encoded_query('thelook','inventory_items','json', query_params)\n\n```\n\nAgain, it is generally easier to use the variant of this method that passes the full query in the POST body.\nThis method is available for cases where other alternatives won't fit the need.\n\nSupported formats:\n\n| result_format | Description\n| :-----------: | :--- |\n| json | Plain json\n| json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| csv | Comma separated values with a header\n| txt | Tab separated values with a header\n| html | Simple html\n| md | Simple markdown\n| xlsx | MS Excel spreadsheet\n| sql | Returns the generated SQL rather than running the query\n| png | A PNG image of the visualization of the query\n| jpg | A JPG image of the visualization of the query\n\n\n", "produces": [ "text", "application/json", @@ -3570,23 +3570,25 @@ { "name": "page", "in": "query", - "description": "Requested page.", + "description": "DEPRECATED. Use limit and offset instead. Return only page N of paginated results", "required": false, "type": "integer", - "format": "int64" + "format": "int64", + "x-looker-deprecated": true }, { "name": "per_page", "in": "query", - "description": "Results per page.", + "description": "DEPRECATED. Use limit and offset instead. Return N rows of data per page", "required": false, "type": "integer", - "format": "int64" + "format": "int64", + "x-looker-deprecated": true } ], "responses": { "200": { - "description": "content", + "description": "Matching content", "schema": { "type": "array", "items": { @@ -4289,7 +4291,7 @@ { "name": "folder_id", "in": "query", - "description": "Filter on a particular space.", + "description": "Filter on a particular folder.", "required": false, "type": "string" }, @@ -7672,6 +7674,53 @@ "x-looker-activity-type": "none" } }, + "/embed/sso/validate": { + "get": { + "tags": [ + "Auth" + ], + "operationId": "validate_embed_url", + "summary": "Get Embed URL Validation", + "description": "### Validate a Signed Embed URL\n\n", + "parameters": [ + { + "name": "url", + "in": "query", + "description": "URL to validate", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Embed URL Validation", + "schema": { + "$ref": "#/definitions/EmbedUrlResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "Validation Error", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + }, + "x-looker-status": "alpha", + "x-looker-activity-type": "non_query" + } + }, "/embed/cookieless_session/acquire": { "post": { "tags": [ @@ -8918,6 +8967,12 @@ "$ref": "#/definitions/Error" } }, + "403": { + "description": "Permission Denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, "404": { "description": "Not Found", "schema": { @@ -9391,6 +9446,12 @@ "$ref": "#/definitions/Error" } }, + "403": { + "description": "Permission Denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, "404": { "description": "Not Found", "schema": { @@ -9440,6 +9501,12 @@ "$ref": "#/definitions/Error" } }, + "403": { + "description": "Permission Denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, "404": { "description": "Not Found", "schema": { @@ -9629,23 +9696,25 @@ { "name": "page", "in": "query", - "description": "The page to return. DEPRECATED. Use offset instead.", + "description": "DEPRECATED. Use limit and offset instead. Return only page N of paginated results", "required": false, "type": "integer", - "format": "int64" + "format": "int64", + "x-looker-deprecated": true }, { "name": "per_page", "in": "query", - "description": "The number of items in the returned page. DEPRECATED. Use limit instead.", + "description": "DEPRECATED. Use limit and offset instead. Return N rows of data per page", "required": false, "type": "integer", - "format": "int64" + "format": "int64", + "x-looker-deprecated": true }, { "name": "offset", "in": "query", - "description": "The number of items to skip before returning any. (used with limit and takes priority over page and per_page)", + "description": "Number of results to return. (used with offset and takes priority over page and per_page)", "required": false, "type": "integer", "format": "int64" @@ -9653,7 +9722,7 @@ { "name": "limit", "in": "query", - "description": "The maximum number of items to return. (used with offset and takes priority over page and per_page)", + "description": "Number of results to skip before returning any. (used with limit and takes priority over page and per_page)", "required": false, "type": "integer", "format": "int64" @@ -11258,6 +11327,12 @@ "$ref": "#/definitions/Error" } }, + "403": { + "description": "Permission Denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, "404": { "description": "Not Found", "schema": { @@ -12095,7 +12170,7 @@ ], "operationId": "update_look", "summary": "Update Look", - "description": "### Modify a Look\n\nUse this function to modify parts of a look. Property values given in a call to `update_look` are\napplied to the existing look, so there's no need to include properties whose values are not changing.\nIt's best to specify only the properties you want to change and leave everything else out\nof your `update_look` call. **Look properties marked 'read-only' will be ignored.**\n\nWhen a user deletes a look in the Looker UI, the look data remains in the database but is\nmarked with a deleted flag (\"soft-deleted\"). Soft-deleted looks can be undeleted (by an admin)\nif the delete was in error.\n\nTo soft-delete a look via the API, use [update_look()](#!/Look/update_look) to change the look's `deleted` property to `true`.\nYou can undelete a look by calling `update_look` to change the look's `deleted` property to `false`.\n\nSoft-deleted looks are excluded from the results of [all_looks()](#!/Look/all_looks) and [search_looks()](#!/Look/search_looks), so they\nessentially disappear from view even though they still reside in the db.\nIn API 3.1 and later, you can pass `deleted: true` as a parameter to [search_looks()](#!/3.1/Look/search_looks) to list soft-deleted looks.\n\nNOTE: [delete_look()](#!/Look/delete_look) performs a \"hard delete\" - the look data is removed from the Looker\ndatabase and destroyed. There is no \"undo\" for `delete_look()`.\n", + "description": "### Modify a Look\n\nUse this function to modify parts of a look. Property values given in a call to `update_look` are\napplied to the existing look, so there's no need to include properties whose values are not changing.\nIt's best to specify only the properties you want to change and leave everything else out\nof your `update_look` call. **Look properties marked 'read-only' will be ignored.**\n\nWhen a user deletes a look in the Looker UI, the look data remains in the database but is\nmarked with a deleted flag (\"soft-deleted\"). Soft-deleted looks can be undeleted (by an admin)\nif the delete was in error.\n\nTo soft-delete a look via the API, use [update_look()](#!/Look/update_look) to change the look's `deleted` property to `true`.\nYou can undelete a look by calling `update_look` to change the look's `deleted` property to `false`.\n\nSoft-deleted looks are excluded from the results of [all_looks()](#!/Look/all_looks) and [search_looks()](#!/Look/search_looks), so they\nessentially disappear from view even though they still reside in the db.\nYou can pass `deleted: true` as a parameter to [search_looks()](#!/Look/search_looks) to list soft-deleted looks.\n\nNOTE: [delete_look()](#!/Look/delete_look) performs a \"hard delete\" - the look data is removed from the Looker\ndatabase and destroyed. There is no \"undo\" for `delete_look()`.\n", "parameters": [ { "name": "look_id", @@ -12209,7 +12284,7 @@ ], "operationId": "run_look", "summary": "Run Look", - "description": "### Run a Look\n\nRuns a given look's query and returns the results in the requested format.\n\nSupported formats:\n\n| result_format | Description\n| :-----------: | :--- |\n| json | Plain json\n| json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| csv | Comma separated values with a header\n| txt | Tab separated values with a header\n| html | Simple html\n| md | Simple markdown\n| xlsx | MS Excel spreadsheet\n| sql | Returns the generated SQL rather than running the query\n| png | A PNG image of the visualization of the query\n| jpg | A JPG image of the visualization of the query\n\n\n", + "description": "### Run a Look\n\nRuns a given look's query and returns the results in the requested format.\n\nSupported formats:\n\n| result_format | Description\n| :-----------: | :--- |\n| json | Plain json\n| json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| csv | Comma separated values with a header\n| txt | Tab separated values with a header\n| html | Simple html\n| md | Simple markdown\n| xlsx | MS Excel spreadsheet\n| sql | Returns the generated SQL rather than running the query\n| png | A PNG image of the visualization of the query\n| jpg | A JPG image of the visualization of the query\n\n\n", "produces": [ "text", "application/json", @@ -13343,7 +13418,7 @@ ], "operationId": "connection_columns", "summary": "Get columns for a connection", - "description": "### Get the columns (and therefore also the tables) in a specific schema\n\n", + "description": "### Get the columns (and therefore also the tables) in a specific schema\n", "parameters": [ { "name": "connection_name", @@ -16815,6 +16890,13 @@ "description": "Whether or not to expand table vis to full length", "required": false, "type": "boolean" + }, + { + "name": "theme", + "in": "query", + "description": "Theme to apply. Will render embedded version of dashboard if valid", + "required": false, + "type": "string" } ], "responses": { @@ -19685,7 +19767,7 @@ ], "operationId": "all_folders", "summary": "Get All Folders", - "description": "### Get information about all folders.\n\nIn API 3.x, this will not return empty personal folders, unless they belong to the calling user,\nor if they contain soft-deleted content.\n\nIn API 4.0+, all personal folders will be returned.\n\n", + "description": "### Get information about all folders.\n\nAll personal folders will be returned.\n\n", "parameters": [ { "name": "fields", @@ -20044,7 +20126,7 @@ ], "operationId": "folder_looks", "summary": "Get Folder Looks", - "description": "### Get all looks in a folder.\nIn API 3.x, this will return all looks in a folder, including looks in the trash.\nIn API 4.0+, all looks in a folder will be returned, excluding looks in the trash.\n", + "description": "### Get all looks in a folder.\nIn API 4.0+, all looks in a folder will be returned, excluding looks in the trash.\n", "parameters": [ { "name": "folder_id", @@ -20139,28 +20221,42 @@ "x-looker-activity-type": "non_query" } }, - "/sql_queries/{slug}": { + "/sql_interface_queries/{query_id}/run/{result_format}": { "get": { "tags": [ "Query" ], - "operationId": "sql_query", - "summary": "Get SQL Runner Query", - "description": "Get a SQL Runner query.", + "operationId": "run_sql_interface_query", + "summary": "Run SQL Interface Query", + "description": "### Run a saved SQL interface query.\n\nThis runs a previously created SQL interface query.\n\nThe 'result_format' parameter specifies the desired structure and format of the response.\n\nSupported formats:\n\n| result_format | Description\n| :-----------: | :--- |\n| json | Plain json\n| json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| csv | Comma separated values with a header\n| txt | Tab separated values with a header\n| html | Simple html\n| md | Simple markdown\n| xlsx | MS Excel spreadsheet\n| sql | Returns the generated SQL rather than running the query\n| png | A PNG image of the visualization of the query\n| jpg | A JPG image of the visualization of the query\n\n\n", + "produces": [ + "text", + "application/json", + "image/png", + "image/jpeg" + ], "parameters": [ { - "name": "slug", + "name": "query_id", "in": "path", - "description": "slug of query", + "description": "Integer id of query", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "name": "result_format", + "in": "path", + "description": "Format of result, options are: [\"json_bi\"]", "required": true, "type": "string" } ], "responses": { "200": { - "description": "SQL Runner Query", + "description": "SQL Interface Query", "schema": { - "$ref": "#/definitions/SqlQuery" + "type": "string" } }, "400": { @@ -20169,14 +20265,99 @@ "$ref": "#/definitions/Error" } }, + "403": { + "description": "Permission Denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/Error" } + }, + "422": { + "description": "Validation Error", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "429": { + "description": "Too Many Requests", + "schema": { + "$ref": "#/definitions/Error" + } } }, - "x-looker-status": "stable", + "x-looker-status": "beta", + "x-looker-activity-type": "db_query" + } + }, + "/sql_interface_queries": { + "post": { + "tags": [ + "Query" + ], + "operationId": "create_sql_interface_query", + "summary": "Create SQL Interface Query", + "description": "### Create a SQL interface query.\n\nThis allows you to create a new SQL interface query that you can later run. Looker queries are immutable once created\nand are not deleted. If you create a query that is exactly like an existing query then the existing query\nwill be returned and no new query will be created. Whether a new query is created or not, you can use\nthe 'id' in the returned query with the 'run' method.\n\nThe query parameters are passed as json in the body of the request.\n\n", + "parameters": [ + { + "name": "body", + "in": "body", + "description": "SQL Interface Query Create", + "required": true, + "schema": { + "$ref": "#/definitions/SqlInterfaceQueryCreate" + } + } + ], + "responses": { + "200": { + "description": "SQL Interface Query", + "schema": { + "$ref": "#/definitions/SqlInterfaceQuery" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "Permission Denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Resource Already Exists", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "Validation Error", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "429": { + "description": "Too Many Requests", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-looker-status": "beta", "x-looker-activity-type": "db_query" } }, @@ -20241,6 +20422,47 @@ "x-looker-activity-type": "db_query" } }, + "/sql_queries/{slug}": { + "get": { + "tags": [ + "Query" + ], + "operationId": "sql_query", + "summary": "Get SQL Runner Query", + "description": "Get a SQL Runner query.", + "parameters": [ + { + "name": "slug", + "in": "path", + "description": "slug of query", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "SQL Runner Query", + "schema": { + "$ref": "#/definitions/SqlQuery" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-looker-status": "stable", + "x-looker-activity-type": "db_query" + } + }, "/sql_queries/{slug}/run/{result_format}": { "post": { "tags": [ @@ -20935,7 +21157,7 @@ ], "operationId": "active_themes", "summary": "Get Active Themes", - "description": "### Get active themes\n\nReturns an array of active themes.\n\nIf the `name` parameter is specified, it will return an array with one theme if it's active and found.\n\nThe optional `ts` parameter can specify a different timestamp than \"now.\"\n\n**Note**: Custom themes needs to be enabled by Looker. Unless custom themes are enabled, only the automatically generated default theme can be used. Please contact your Account Manager or help.looker.com to update your license for this feature.\n\n\n", + "description": "### Get active themes\n\nReturns an array of active themes.\n\nIf the `name` parameter is specified, it will return an array with one theme if it's active and found.\n\nThe optional `ts` parameter can specify a different timestamp than \"now.\"\n\n**Note**: Custom themes needs to be enabled by Looker. Unless custom themes are enabled, only the automatically generated default theme can be used. Please contact your Account Manager or help.looker.com to update your license for this feature.\n\n", "parameters": [ { "name": "name", @@ -25480,8 +25702,8 @@ "Config" ], "operationId": "whitelabel_configuration", - "summary": "Get Whitelabel configuration", - "description": "### This feature is enabled only by special license.\n### Gets the whitelabel configuration, which includes hiding documentation links, custom favicon uploading, etc.\n", + "summary": "Get Private label configuration", + "description": "### This feature is enabled only by special license.\n\nThis endpoint provides the private label configuration, which includes hiding documentation links, custom favicon uploading, etc.\n\nThis endpoint is deprecated. [Get Setting](#!/Config/get_setting) should be used to retrieve private label settings instead\n", "parameters": [ { "name": "fields", @@ -25493,7 +25715,7 @@ ], "responses": { "200": { - "description": "Whitelabel configuration", + "description": "Private label configuration", "schema": { "$ref": "#/definitions/WhitelabelConfiguration" } @@ -25520,13 +25742,13 @@ "Config" ], "operationId": "update_whitelabel_configuration", - "summary": "Update Whitelabel configuration", - "description": "### Update the whitelabel configuration\n", + "summary": "Update Private label configuration", + "description": "### Update the private label configuration\n\nThis endpoint is deprecated. [Set Setting](#!/Config/set_setting) should be used to update private label settings instead\n", "parameters": [ { "name": "body", "in": "body", - "description": "Whitelabel configuration", + "description": "Private label configuration", "required": true, "schema": { "$ref": "#/definitions/WhitelabelConfiguration" @@ -25535,7 +25757,7 @@ ], "responses": { "200": { - "description": "Whitelabel configuration", + "description": "Private label configuration", "schema": { "$ref": "#/definitions/WhitelabelConfiguration" } @@ -26257,7 +26479,7 @@ }, "cron": { "type": "string", - "description": "Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals", + "description": "Vixie-Style crontab specification when to run. At minimum, it has to be longer than 15 minute intervals", "x-looker-nullable": false }, "custom_url_base": { @@ -30213,13 +30435,11 @@ "type": "integer", "format": "int64", "description": "This field is only applicable to connections over an SSH Tunnel. The value of this field would be the local port associated with the SSH tunnel if configured manually. Otherwise either enter NULL or exclude this field.", - "x-looker-undocumented": false, "x-looker-nullable": true }, "tunnel_id": { "type": "string", "description": "The Id of the ssh tunnel this connection uses", - "x-looker-undocumented": false, "x-looker-nullable": true }, "uses_tns": { @@ -30642,7 +30862,7 @@ "supports_streaming": { "type": "boolean", "readOnly": true, - "description": "Suports streaming results", + "description": "Supports streaming results", "x-looker-nullable": false }, "automatically_run_sql_runner_snippets": { @@ -32304,7 +32524,7 @@ "type": "string" }, "readOnly": true, - "description": "If present, supercedes 'tag' and matches a field that has any of the provided tags.", + "description": "If present, supersedes 'tag' and matches a field that has any of the provided tags.", "x-looker-nullable": true }, "all_tags": { @@ -32313,7 +32533,7 @@ "type": "string" }, "readOnly": true, - "description": "If present, supercedes 'tag' and matches a field that has all of the provided tags.", + "description": "If present, supersedes 'tag' and matches a field that has all of the provided tags.", "x-looker-nullable": true } }, @@ -33784,7 +34004,6 @@ "type": "string", "readOnly": true, "description": "Explore title", - "x-looker-undocumented": false, "x-looker-nullable": true }, "scopes": { @@ -33806,21 +34025,18 @@ "type": "boolean", "readOnly": true, "description": "Can Develop LookML", - "x-looker-undocumented": false, "x-looker-nullable": false }, "can_see_lookml": { "type": "boolean", "readOnly": true, "description": "Can See LookML", - "x-looker-undocumented": false, "x-looker-nullable": false }, "lookml_link": { "type": "string", "readOnly": true, "description": "A URL linking to the definition of this explore in the LookML IDE.", - "x-looker-undocumented": false, "x-looker-nullable": true }, "can_save": { @@ -36035,6 +36251,13 @@ "type": "string", "description": "Status of dependencies in your manifest & lockfile", "x-looker-nullable": true + }, + "data_tests_count": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "Number of data tests within project", + "x-looker-nullable": false } }, "x-looker-status": "stable" @@ -38820,6 +39043,63 @@ }, "x-looker-status": "stable" }, + "SqlInterfaceQueryCreate": { + "properties": { + "can": { + "type": "object", + "additionalProperties": { + "type": "boolean" + }, + "readOnly": true, + "description": "Operations the current user is able to perform on this object", + "x-looker-nullable": false + }, + "sql": { + "type": "string", + "description": "Original SQL request", + "x-looker-nullable": true + }, + "jdbc_client": { + "type": "boolean", + "description": "Whether the query should be run for use in a JDBC Client. This changes the formatting of some datetime based values.", + "x-looker-nullable": false + } + }, + "x-looker-status": "stable", + "required": [ + "sql" + ] + }, + "SqlInterfaceQuery": { + "properties": { + "can": { + "type": "object", + "additionalProperties": { + "type": "boolean" + }, + "readOnly": true, + "description": "Operations the current user is able to perform on this object", + "x-looker-nullable": false + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "Unique Id", + "x-looker-nullable": false + }, + "signature": { + "type": "string", + "readOnly": true, + "description": "Calcite signature", + "x-looker-nullable": true + } + }, + "x-looker-status": "stable", + "required": [ + "signature" + ] + }, "SqlQueryCreate": { "properties": { "connection_name": { diff --git a/spec/Looker.4.0.oas.json b/spec/Looker.4.0.oas.json index 8a19e8ed1..dd2134a93 100644 --- a/spec/Looker.4.0.oas.json +++ b/spec/Looker.4.0.oas.json @@ -1,8 +1,8 @@ { "openapi": "3.0.0", "info": { - "version": "4.0.23.14", - "x-looker-release-version": "23.14.9", + "version": "4.0.23.17", + "x-looker-release-version": "23.17.75", "title": "Looker API 4.0 Reference", "description": "\nAPI 4.0 is the current release of the Looker API. API 3.1 is deprecated.\n\n### Authorization\n\nThe classic method of API authorization uses Looker **API** credentials for authorization and access control.\nLooker admins can create API credentials on Looker's **Admin/Users** page.\n\nAPI 4.0 adds additional ways to authenticate API requests, including OAuth and CORS requests.\n\nFor details, see [Looker API Authorization](https://cloud.google.com/looker/docs/r/api/authorization).\n\n\n### API Explorer\n\nThe API Explorer is a Looker-provided utility with many new and unique features for learning and using the Looker API and SDKs.\n\nFor details, see the [API Explorer documentation](https://cloud.google.com/looker/docs/r/api/explorer).\n\n\n### Looker Language SDKs\n\nThe Looker API is a RESTful system that should be usable by any programming language capable of making\nHTTPS requests. SDKs for a variety of programming languages are also provided to streamline using the API. Looker\nhas an OpenSource [sdk-codegen project](https://github.com/looker-open-source/sdk-codegen) that provides several\nlanguage SDKs. Language SDKs generated by `sdk-codegen` have an Authentication manager that can automatically\nauthenticate API requests when needed.\n\nFor details on available Looker SDKs, see [Looker API Client SDKs](https://cloud.google.com/looker/docs/r/api/client_sdks).\n\n\n### API Versioning\n\nFuture releases of Looker expand the latest API version release-by-release to securely expose more and more of the core\npower of the Looker platform to API client applications. API endpoints marked as \"beta\" may receive breaking changes without\nwarning (but we will try to avoid doing that). Stable (non-beta) API endpoints should not receive breaking\nchanges in future releases.\n\nFor details, see [Looker API Versioning](https://cloud.google.com/looker/docs/r/api/versioning).\n\n\n### In This Release\n\nAPI 4.0 version was introduced to make adjustments to API functions, parameters, and response types to\nfix bugs and inconsistencies. These changes fall outside the bounds of non-breaking additive changes we can\nmake to the previous API 3.1.\n\nOne benefit of these type adjustments in API 4.0 is dramatically better support for strongly\ntyped languages like TypeScript, Kotlin, Swift, Go, C#, and more.\n\nSee the [API 4.0 GA announcement](https://developers.looker.com/api/advanced-usage/version-4-ga) for more information\nabout API 4.0.\n\nThe API Explorer can be used to [interactively compare](https://cloud.google.com/looker/docs/r/api/explorer#comparing_api_versions) the differences between API 3.1 and 4.0.\n\n\n### API and SDK Support Policies\n\nLooker API versions and language SDKs have varying support levels. Please read the API and SDK\n[support policies](https://cloud.google.com/looker/docs/r/api/support-policy) for more information.\n\n\n", "contact": { @@ -11,7 +11,7 @@ }, "license": { "name": "EULA", - "url": "https://localhost:10000/eula" + "url": "https://gcplmaster.dev.looker.com/eula" } }, "tags": [ @@ -794,7 +794,7 @@ ], "operationId": "run_query", "summary": "Run Query", - "description": "### Run a saved query.\n\nThis runs a previously saved query. You can use this on a query that was generated in the Looker UI\nor one that you have explicitly created using the API. You can also use a query 'id' from a saved 'Look'.\n\nThe 'result_format' parameter specifies the desired structure and format of the response.\n\nSupported formats:\n\n| result_format | Description\n| :-----------: | :--- |\n| json | Plain json\n| json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| csv | Comma separated values with a header\n| txt | Tab separated values with a header\n| html | Simple html\n| md | Simple markdown\n| xlsx | MS Excel spreadsheet\n| sql | Returns the generated SQL rather than running the query\n| png | A PNG image of the visualization of the query\n| jpg | A JPG image of the visualization of the query\n\n\n", + "description": "### Run a saved query.\n\nThis runs a previously saved query. You can use this on a query that was generated in the Looker UI\nor one that you have explicitly created using the API. You can also use a query 'id' from a saved 'Look'.\n\nThe 'result_format' parameter specifies the desired structure and format of the response.\n\nSupported formats:\n\n| result_format | Description\n| :-----------: | :--- |\n| json | Plain json\n| json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| csv | Comma separated values with a header\n| txt | Tab separated values with a header\n| html | Simple html\n| md | Simple markdown\n| xlsx | MS Excel spreadsheet\n| sql | Returns the generated SQL rather than running the query\n| png | A PNG image of the visualization of the query\n| jpg | A JPG image of the visualization of the query\n\n\n", "parameters": [ { "name": "query_id", @@ -1073,7 +1073,7 @@ ], "operationId": "run_inline_query", "summary": "Run Inline Query", - "description": "### Run the query that is specified inline in the posted body.\n\nThis allows running a query as defined in json in the posted body. This combines\nthe two actions of posting & running a query into one step.\n\nHere is an example body in json:\n```\n{\n \"model\":\"thelook\",\n \"view\":\"inventory_items\",\n \"fields\":[\"category.name\",\"inventory_items.days_in_inventory_tier\",\"products.count\"],\n \"filters\":{\"category.name\":\"socks\"},\n \"sorts\":[\"products.count desc 0\"],\n \"limit\":\"500\",\n \"query_timezone\":\"America/Los_Angeles\"\n}\n```\n\nWhen using the Ruby SDK this would be passed as a Ruby hash like:\n```\n{\n :model=>\"thelook\",\n :view=>\"inventory_items\",\n :fields=>\n [\"category.name\",\n \"inventory_items.days_in_inventory_tier\",\n \"products.count\"],\n :filters=>{:\"category.name\"=>\"socks\"},\n :sorts=>[\"products.count desc 0\"],\n :limit=>\"500\",\n :query_timezone=>\"America/Los_Angeles\",\n}\n```\n\nThis will return the result of running the query in the format specified by the 'result_format' parameter.\n\nSupported formats:\n\n| result_format | Description\n| :-----------: | :--- |\n| json | Plain json\n| json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| csv | Comma separated values with a header\n| txt | Tab separated values with a header\n| html | Simple html\n| md | Simple markdown\n| xlsx | MS Excel spreadsheet\n| sql | Returns the generated SQL rather than running the query\n| png | A PNG image of the visualization of the query\n| jpg | A JPG image of the visualization of the query\n\n\n", + "description": "### Run the query that is specified inline in the posted body.\n\nThis allows running a query as defined in json in the posted body. This combines\nthe two actions of posting & running a query into one step.\n\nHere is an example body in json:\n```\n{\n \"model\":\"thelook\",\n \"view\":\"inventory_items\",\n \"fields\":[\"category.name\",\"inventory_items.days_in_inventory_tier\",\"products.count\"],\n \"filters\":{\"category.name\":\"socks\"},\n \"sorts\":[\"products.count desc 0\"],\n \"limit\":\"500\",\n \"query_timezone\":\"America/Los_Angeles\"\n}\n```\n\nWhen using the Ruby SDK this would be passed as a Ruby hash like:\n```\n{\n :model=>\"thelook\",\n :view=>\"inventory_items\",\n :fields=>\n [\"category.name\",\n \"inventory_items.days_in_inventory_tier\",\n \"products.count\"],\n :filters=>{:\"category.name\"=>\"socks\"},\n :sorts=>[\"products.count desc 0\"],\n :limit=>\"500\",\n :query_timezone=>\"America/Los_Angeles\",\n}\n```\n\nThis will return the result of running the query in the format specified by the 'result_format' parameter.\n\nSupported formats:\n\n| result_format | Description\n| :-----------: | :--- |\n| json | Plain json\n| json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| csv | Comma separated values with a header\n| txt | Tab separated values with a header\n| html | Simple html\n| md | Simple markdown\n| xlsx | MS Excel spreadsheet\n| sql | Returns the generated SQL rather than running the query\n| png | A PNG image of the visualization of the query\n| jpg | A JPG image of the visualization of the query\n\n\n", "parameters": [ { "name": "result_format", @@ -1345,7 +1345,7 @@ ], "operationId": "run_url_encoded_query", "summary": "Run Url Encoded Query", - "description": "### Run an URL encoded query.\n\nThis requires the caller to encode the specifiers for the query into the URL query part using\nLooker-specific syntax as explained below.\n\nGenerally, you would want to use one of the methods that takes the parameters as json in the POST body\nfor creating and/or running queries. This method exists for cases where one really needs to encode the\nparameters into the URL of a single 'GET' request. This matches the way that the Looker UI formats\n'explore' URLs etc.\n\nThe parameters here are very similar to the json body formatting except that the filter syntax is\ntricky. Unfortunately, this format makes this method not currently callable via the 'Try it out!' button\nin this documentation page. But, this is callable when creating URLs manually or when using the Looker SDK.\n\nHere is an example inline query URL:\n\n```\nhttps://looker.mycompany.com:19999/api/3.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles\n```\n\nWhen invoking this endpoint with the Ruby SDK, pass the query parameter parts as a hash. The hash to match the above would look like:\n\n```ruby\nquery_params =\n{\n fields: \"category.name,inventory_items.days_in_inventory_tier,products.count\",\n :\"f[category.name]\" => \"socks\",\n sorts: \"products.count desc 0\",\n limit: \"500\",\n query_timezone: \"America/Los_Angeles\"\n}\nresponse = ruby_sdk.run_url_encoded_query('thelook','inventory_items','json', query_params)\n\n```\n\nAgain, it is generally easier to use the variant of this method that passes the full query in the POST body.\nThis method is available for cases where other alternatives won't fit the need.\n\nSupported formats:\n\n| result_format | Description\n| :-----------: | :--- |\n| json | Plain json\n| json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| csv | Comma separated values with a header\n| txt | Tab separated values with a header\n| html | Simple html\n| md | Simple markdown\n| xlsx | MS Excel spreadsheet\n| sql | Returns the generated SQL rather than running the query\n| png | A PNG image of the visualization of the query\n| jpg | A JPG image of the visualization of the query\n\n\n", + "description": "### Run an URL encoded query.\n\nThis requires the caller to encode the specifiers for the query into the URL query part using\nLooker-specific syntax as explained below.\n\nGenerally, you would want to use one of the methods that takes the parameters as json in the POST body\nfor creating and/or running queries. This method exists for cases where one really needs to encode the\nparameters into the URL of a single 'GET' request. This matches the way that the Looker UI formats\n'explore' URLs etc.\n\nThe parameters here are very similar to the json body formatting except that the filter syntax is\ntricky. Unfortunately, this format makes this method not currently callable via the 'Try it out!' button\nin this documentation page. But, this is callable when creating URLs manually or when using the Looker SDK.\n\nHere is an example inline query URL:\n\n```\nhttps://looker.mycompany.com:19999/api/4.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles\n```\n\nWhen invoking this endpoint with the Ruby SDK, pass the query parameter parts as a hash. The hash to match the above would look like:\n\n```ruby\nquery_params =\n{\n fields: \"category.name,inventory_items.days_in_inventory_tier,products.count\",\n :\"f[category.name]\" => \"socks\",\n sorts: \"products.count desc 0\",\n limit: \"500\",\n query_timezone: \"America/Los_Angeles\"\n}\nresponse = ruby_sdk.run_url_encoded_query('thelook','inventory_items','json', query_params)\n\n```\n\nAgain, it is generally easier to use the variant of this method that passes the full query in the POST body.\nThis method is available for cases where other alternatives won't fit the need.\n\nSupported formats:\n\n| result_format | Description\n| :-----------: | :--- |\n| json | Plain json\n| json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| csv | Comma separated values with a header\n| txt | Tab separated values with a header\n| html | Simple html\n| md | Simple markdown\n| xlsx | MS Excel spreadsheet\n| sql | Returns the generated SQL rather than running the query\n| png | A PNG image of the visualization of the query\n| jpg | A JPG image of the visualization of the query\n\n\n", "parameters": [ { "name": "model_name", @@ -4978,8 +4978,9 @@ { "name": "page", "in": "query", - "description": "Requested page.", + "description": "DEPRECATED. Use limit and offset instead. Return only page N of paginated results", "required": false, + "deprecated": true, "schema": { "type": "integer", "format": "int64" @@ -4988,8 +4989,9 @@ { "name": "per_page", "in": "query", - "description": "Results per page.", + "description": "DEPRECATED. Use limit and offset instead. Return N rows of data per page", "required": false, + "deprecated": true, "schema": { "type": "integer", "format": "int64" @@ -4998,7 +5000,7 @@ ], "responses": { "200": { - "description": "content", + "description": "Matching content", "content": { "application/json": { "schema": { @@ -5955,7 +5957,7 @@ { "name": "folder_id", "in": "query", - "description": "Filter on a particular space.", + "description": "Filter on a particular folder.", "required": false, "schema": { "type": "string" @@ -10588,6 +10590,71 @@ } } }, + "/embed/sso/validate": { + "get": { + "tags": [ + "Auth" + ], + "operationId": "validate_embed_url", + "summary": "Get Embed URL Validation", + "description": "### Validate a Signed Embed URL\n\n", + "parameters": [ + { + "name": "url", + "in": "query", + "description": "URL to validate", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Embed URL Validation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmbedUrlResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationError" + } + } + } + } + }, + "x-looker-status": "alpha", + "x-looker-activity-type": "non_query" + } + }, "/embed/cookieless_session/acquire": { "post": { "tags": [ @@ -12254,6 +12321,16 @@ } } }, + "403": { + "description": "Permission Denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, "404": { "description": "Not Found", "content": { @@ -12889,6 +12966,16 @@ } } }, + "403": { + "description": "Permission Denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, "404": { "description": "Not Found", "content": { @@ -12965,6 +13052,16 @@ } } }, + "403": { + "description": "Permission Denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, "404": { "description": "Not Found", "content": { @@ -13216,8 +13313,9 @@ { "name": "page", "in": "query", - "description": "The page to return. DEPRECATED. Use offset instead.", + "description": "DEPRECATED. Use limit and offset instead. Return only page N of paginated results", "required": false, + "deprecated": true, "schema": { "type": "integer", "format": "int64" @@ -13226,8 +13324,9 @@ { "name": "per_page", "in": "query", - "description": "The number of items in the returned page. DEPRECATED. Use limit instead.", + "description": "DEPRECATED. Use limit and offset instead. Return N rows of data per page", "required": false, + "deprecated": true, "schema": { "type": "integer", "format": "int64" @@ -13236,7 +13335,7 @@ { "name": "offset", "in": "query", - "description": "The number of items to skip before returning any. (used with limit and takes priority over page and per_page)", + "description": "Number of results to return. (used with offset and takes priority over page and per_page)", "required": false, "schema": { "type": "integer", @@ -13246,7 +13345,7 @@ { "name": "limit", "in": "query", - "description": "The maximum number of items to return. (used with offset and takes priority over page and per_page)", + "description": "Number of results to skip before returning any. (used with limit and takes priority over page and per_page)", "required": false, "schema": { "type": "integer", @@ -15443,6 +15542,16 @@ } } }, + "403": { + "description": "Permission Denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, "404": { "description": "Not Found", "content": { @@ -16576,7 +16685,7 @@ ], "operationId": "update_look", "summary": "Update Look", - "description": "### Modify a Look\n\nUse this function to modify parts of a look. Property values given in a call to `update_look` are\napplied to the existing look, so there's no need to include properties whose values are not changing.\nIt's best to specify only the properties you want to change and leave everything else out\nof your `update_look` call. **Look properties marked 'read-only' will be ignored.**\n\nWhen a user deletes a look in the Looker UI, the look data remains in the database but is\nmarked with a deleted flag (\"soft-deleted\"). Soft-deleted looks can be undeleted (by an admin)\nif the delete was in error.\n\nTo soft-delete a look via the API, use [update_look()](#!/Look/update_look) to change the look's `deleted` property to `true`.\nYou can undelete a look by calling `update_look` to change the look's `deleted` property to `false`.\n\nSoft-deleted looks are excluded from the results of [all_looks()](#!/Look/all_looks) and [search_looks()](#!/Look/search_looks), so they\nessentially disappear from view even though they still reside in the db.\nIn API 3.1 and later, you can pass `deleted: true` as a parameter to [search_looks()](#!/3.1/Look/search_looks) to list soft-deleted looks.\n\nNOTE: [delete_look()](#!/Look/delete_look) performs a \"hard delete\" - the look data is removed from the Looker\ndatabase and destroyed. There is no \"undo\" for `delete_look()`.\n", + "description": "### Modify a Look\n\nUse this function to modify parts of a look. Property values given in a call to `update_look` are\napplied to the existing look, so there's no need to include properties whose values are not changing.\nIt's best to specify only the properties you want to change and leave everything else out\nof your `update_look` call. **Look properties marked 'read-only' will be ignored.**\n\nWhen a user deletes a look in the Looker UI, the look data remains in the database but is\nmarked with a deleted flag (\"soft-deleted\"). Soft-deleted looks can be undeleted (by an admin)\nif the delete was in error.\n\nTo soft-delete a look via the API, use [update_look()](#!/Look/update_look) to change the look's `deleted` property to `true`.\nYou can undelete a look by calling `update_look` to change the look's `deleted` property to `false`.\n\nSoft-deleted looks are excluded from the results of [all_looks()](#!/Look/all_looks) and [search_looks()](#!/Look/search_looks), so they\nessentially disappear from view even though they still reside in the db.\nYou can pass `deleted: true` as a parameter to [search_looks()](#!/Look/search_looks) to list soft-deleted looks.\n\nNOTE: [delete_look()](#!/Look/delete_look) performs a \"hard delete\" - the look data is removed from the Looker\ndatabase and destroyed. There is no \"undo\" for `delete_look()`.\n", "parameters": [ { "name": "look_id", @@ -16734,7 +16843,7 @@ ], "operationId": "run_look", "summary": "Run Look", - "description": "### Run a Look\n\nRuns a given look's query and returns the results in the requested format.\n\nSupported formats:\n\n| result_format | Description\n| :-----------: | :--- |\n| json | Plain json\n| json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| csv | Comma separated values with a header\n| txt | Tab separated values with a header\n| html | Simple html\n| md | Simple markdown\n| xlsx | MS Excel spreadsheet\n| sql | Returns the generated SQL rather than running the query\n| png | A PNG image of the visualization of the query\n| jpg | A JPG image of the visualization of the query\n\n\n", + "description": "### Run a Look\n\nRuns a given look's query and returns the results in the requested format.\n\nSupported formats:\n\n| result_format | Description\n| :-----------: | :--- |\n| json | Plain json\n| json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| csv | Comma separated values with a header\n| txt | Tab separated values with a header\n| html | Simple html\n| md | Simple markdown\n| xlsx | MS Excel spreadsheet\n| sql | Returns the generated SQL rather than running the query\n| png | A PNG image of the visualization of the query\n| jpg | A JPG image of the visualization of the query\n\n\n", "parameters": [ { "name": "look_id", @@ -18347,7 +18456,7 @@ ], "operationId": "connection_columns", "summary": "Get columns for a connection", - "description": "### Get the columns (and therefore also the tables) in a specific schema\n\n", + "description": "### Get the columns (and therefore also the tables) in a specific schema\n", "parameters": [ { "name": "connection_name", @@ -23074,6 +23183,15 @@ "schema": { "type": "boolean" } + }, + { + "name": "theme", + "in": "query", + "description": "Theme to apply. Will render embedded version of dashboard if valid", + "required": false, + "schema": { + "type": "string" + } } ], "responses": { @@ -27003,7 +27121,7 @@ ], "operationId": "all_folders", "summary": "Get All Folders", - "description": "### Get information about all folders.\n\nIn API 3.x, this will not return empty personal folders, unless they belong to the calling user,\nor if they contain soft-deleted content.\n\nIn API 4.0+, all personal folders will be returned.\n\n", + "description": "### Get information about all folders.\n\nAll personal folders will be returned.\n\n", "parameters": [ { "name": "fields", @@ -27478,7 +27596,7 @@ ], "operationId": "folder_looks", "summary": "Get Folder Looks", - "description": "### Get all looks in a folder.\nIn API 3.x, this will return all looks in a folder, including looks in the trash.\nIn API 4.0+, all looks in a folder will be returned, excluding looks in the trash.\n", + "description": "### Get all looks in a folder.\nIn API 4.0+, all looks in a folder will be returned, excluding looks in the trash.\n", "parameters": [ { "name": "folder_id", @@ -27605,19 +27723,29 @@ "x-looker-activity-type": "non_query" } }, - "/sql_queries/{slug}": { + "/sql_interface_queries/{query_id}/run/{result_format}": { "get": { "tags": [ "Query" ], - "operationId": "sql_query", - "summary": "Get SQL Runner Query", - "description": "Get a SQL Runner query.", + "operationId": "run_sql_interface_query", + "summary": "Run SQL Interface Query", + "description": "### Run a saved SQL interface query.\n\nThis runs a previously created SQL interface query.\n\nThe 'result_format' parameter specifies the desired structure and format of the response.\n\nSupported formats:\n\n| result_format | Description\n| :-----------: | :--- |\n| json | Plain json\n| json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query\n| csv | Comma separated values with a header\n| txt | Tab separated values with a header\n| html | Simple html\n| md | Simple markdown\n| xlsx | MS Excel spreadsheet\n| sql | Returns the generated SQL rather than running the query\n| png | A PNG image of the visualization of the query\n| jpg | A JPG image of the visualization of the query\n\n\n", "parameters": [ { - "name": "slug", + "name": "query_id", "in": "path", - "description": "slug of query", + "description": "Integer id of query", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "result_format", + "in": "path", + "description": "Format of result, options are: [\"json_bi\"]", "required": true, "schema": { "type": "string" @@ -27626,11 +27754,26 @@ ], "responses": { "200": { - "description": "SQL Runner Query", + "description": "SQL Interface Query", "content": { + "text": { + "schema": { + "type": "string" + } + }, "application/json": { "schema": { - "$ref": "#/components/schemas/SqlQuery" + "type": "string" + } + }, + "image/png": { + "schema": { + "type": "string" + } + }, + "image/jpeg": { + "schema": { + "type": "string" } } } @@ -27638,28 +27781,228 @@ "400": { "description": "Bad Request", "content": { + "text": { + "schema": { + "$ref": "#/components/schemas/Error" + } + }, "application/json": { "schema": { "$ref": "#/components/schemas/Error" } + }, + "image/png": { + "schema": { + "$ref": "#/components/schemas/Error" + } + }, + "image/jpeg": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "403": { + "description": "Permission Denied", + "content": { + "text": { + "schema": { + "$ref": "#/components/schemas/Error" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + }, + "image/png": { + "schema": { + "$ref": "#/components/schemas/Error" + } + }, + "image/jpeg": { + "schema": { + "$ref": "#/components/schemas/Error" + } } } }, "404": { "description": "Not Found", "content": { + "text": { + "schema": { + "$ref": "#/components/schemas/Error" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + }, + "image/png": { + "schema": { + "$ref": "#/components/schemas/Error" + } + }, + "image/jpeg": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "text": { + "schema": { + "$ref": "#/components/schemas/ValidationError" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationError" + } + }, + "image/png": { + "schema": { + "$ref": "#/components/schemas/ValidationError" + } + }, + "image/jpeg": { + "schema": { + "$ref": "#/components/schemas/ValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "text": { + "schema": { + "$ref": "#/components/schemas/Error" + } + }, "application/json": { "schema": { "$ref": "#/components/schemas/Error" } + }, + "image/png": { + "schema": { + "$ref": "#/components/schemas/Error" + } + }, + "image/jpeg": { + "schema": { + "$ref": "#/components/schemas/Error" + } } } } }, - "x-looker-status": "stable", + "x-looker-status": "beta", "x-looker-activity-type": "db_query" } }, + "/sql_interface_queries": { + "post": { + "tags": [ + "Query" + ], + "operationId": "create_sql_interface_query", + "summary": "Create SQL Interface Query", + "description": "### Create a SQL interface query.\n\nThis allows you to create a new SQL interface query that you can later run. Looker queries are immutable once created\nand are not deleted. If you create a query that is exactly like an existing query then the existing query\nwill be returned and no new query will be created. Whether a new query is created or not, you can use\nthe 'id' in the returned query with the 'run' method.\n\nThe query parameters are passed as json in the body of the request.\n\n", + "responses": { + "200": { + "description": "SQL Interface Query", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SqlInterfaceQuery" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "403": { + "description": "Permission Denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "409": { + "description": "Resource Already Exists", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + }, + "x-looker-status": "beta", + "x-looker-activity-type": "db_query", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SqlInterfaceQueryCreate" + } + } + }, + "description": "SQL Interface Query Create", + "required": true + } + } + }, "/sql_queries": { "post": { "tags": [ @@ -27745,6 +28088,61 @@ } } }, + "/sql_queries/{slug}": { + "get": { + "tags": [ + "Query" + ], + "operationId": "sql_query", + "summary": "Get SQL Runner Query", + "description": "Get a SQL Runner query.", + "parameters": [ + { + "name": "slug", + "in": "path", + "description": "slug of query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "SQL Runner Query", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SqlQuery" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + }, + "x-looker-status": "stable", + "x-looker-activity-type": "db_query" + } + }, "/sql_queries/{slug}/run/{result_format}": { "post": { "tags": [ @@ -28766,7 +29164,7 @@ ], "operationId": "active_themes", "summary": "Get Active Themes", - "description": "### Get active themes\n\nReturns an array of active themes.\n\nIf the `name` parameter is specified, it will return an array with one theme if it's active and found.\n\nThe optional `ts` parameter can specify a different timestamp than \"now.\"\n\n**Note**: Custom themes needs to be enabled by Looker. Unless custom themes are enabled, only the automatically generated default theme can be used. Please contact your Account Manager or help.looker.com to update your license for this feature.\n\n\n", + "description": "### Get active themes\n\nReturns an array of active themes.\n\nIf the `name` parameter is specified, it will return an array with one theme if it's active and found.\n\nThe optional `ts` parameter can specify a different timestamp than \"now.\"\n\n**Note**: Custom themes needs to be enabled by Looker. Unless custom themes are enabled, only the automatically generated default theme can be used. Please contact your Account Manager or help.looker.com to update your license for this feature.\n\n", "parameters": [ { "name": "name", @@ -34962,8 +35360,8 @@ "Config" ], "operationId": "whitelabel_configuration", - "summary": "Get Whitelabel configuration", - "description": "### This feature is enabled only by special license.\n### Gets the whitelabel configuration, which includes hiding documentation links, custom favicon uploading, etc.\n", + "summary": "Get Private label configuration", + "description": "### This feature is enabled only by special license.\n\nThis endpoint provides the private label configuration, which includes hiding documentation links, custom favicon uploading, etc.\n\nThis endpoint is deprecated. [Get Setting](#!/Config/get_setting) should be used to retrieve private label settings instead\n", "parameters": [ { "name": "fields", @@ -34977,7 +35375,7 @@ ], "responses": { "200": { - "description": "Whitelabel configuration", + "description": "Private label configuration", "content": { "application/json": { "schema": { @@ -35016,11 +35414,11 @@ "Config" ], "operationId": "update_whitelabel_configuration", - "summary": "Update Whitelabel configuration", - "description": "### Update the whitelabel configuration\n", + "summary": "Update Private label configuration", + "description": "### Update the private label configuration\n\nThis endpoint is deprecated. [Set Setting](#!/Config/set_setting) should be used to update private label settings instead\n", "responses": { "200": { - "description": "Whitelabel configuration", + "description": "Private label configuration", "content": { "application/json": { "schema": { @@ -35081,7 +35479,7 @@ } } }, - "description": "Whitelabel configuration", + "description": "Private label configuration", "required": true } } @@ -35191,7 +35589,7 @@ }, "servers": [ { - "url": "https://localhost:20000/api/4.0" + "url": "https://gcplmaster.dev.looker.com:443/api/4.0" } ], "components": { @@ -35800,7 +36198,7 @@ }, "cron": { "type": "string", - "description": "Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals", + "description": "Vixie-Style crontab specification when to run. At minimum, it has to be longer than 15 minute intervals", "nullable": false }, "custom_url_base": { @@ -39690,13 +40088,11 @@ "type": "integer", "format": "int64", "description": "This field is only applicable to connections over an SSH Tunnel. The value of this field would be the local port associated with the SSH tunnel if configured manually. Otherwise either enter NULL or exclude this field.", - "x-looker-undocumented": false, "nullable": true }, "tunnel_id": { "type": "string", "description": "The Id of the ssh tunnel this connection uses", - "x-looker-undocumented": false, "nullable": true }, "uses_tns": { @@ -40116,7 +40512,7 @@ "supports_streaming": { "type": "boolean", "readOnly": true, - "description": "Suports streaming results", + "description": "Supports streaming results", "nullable": false }, "automatically_run_sql_runner_snippets": { @@ -41778,7 +42174,7 @@ "type": "string" }, "readOnly": true, - "description": "If present, supercedes 'tag' and matches a field that has any of the provided tags.", + "description": "If present, supersedes 'tag' and matches a field that has any of the provided tags.", "nullable": true }, "all_tags": { @@ -41787,7 +42183,7 @@ "type": "string" }, "readOnly": true, - "description": "If present, supercedes 'tag' and matches a field that has all of the provided tags.", + "description": "If present, supersedes 'tag' and matches a field that has all of the provided tags.", "nullable": true } }, @@ -43234,7 +43630,6 @@ "type": "string", "readOnly": true, "description": "Explore title", - "x-looker-undocumented": false, "nullable": true }, "scopes": { @@ -43256,21 +43651,18 @@ "type": "boolean", "readOnly": true, "description": "Can Develop LookML", - "x-looker-undocumented": false, "nullable": false }, "can_see_lookml": { "type": "boolean", "readOnly": true, "description": "Can See LookML", - "x-looker-undocumented": false, "nullable": false }, "lookml_link": { "type": "string", "readOnly": true, "description": "A URL linking to the definition of this explore in the LookML IDE.", - "x-looker-undocumented": false, "nullable": true }, "can_save": { @@ -45470,6 +45862,13 @@ "type": "string", "description": "Status of dependencies in your manifest & lockfile", "nullable": true + }, + "data_tests_count": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "Number of data tests within project", + "nullable": false } }, "x-looker-status": "stable" @@ -48207,6 +48606,63 @@ }, "x-looker-status": "stable" }, + "SqlInterfaceQueryCreate": { + "properties": { + "can": { + "type": "object", + "additionalProperties": { + "type": "boolean" + }, + "readOnly": true, + "description": "Operations the current user is able to perform on this object", + "nullable": false + }, + "sql": { + "type": "string", + "description": "Original SQL request", + "nullable": true + }, + "jdbc_client": { + "type": "boolean", + "description": "Whether the query should be run for use in a JDBC Client. This changes the formatting of some datetime based values.", + "nullable": false + } + }, + "x-looker-status": "stable", + "required": [ + "sql" + ] + }, + "SqlInterfaceQuery": { + "properties": { + "can": { + "type": "object", + "additionalProperties": { + "type": "boolean" + }, + "readOnly": true, + "description": "Operations the current user is able to perform on this object", + "nullable": false + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "Unique Id", + "nullable": false + }, + "signature": { + "type": "string", + "readOnly": true, + "description": "Calcite signature", + "nullable": true + } + }, + "x-looker-status": "stable", + "required": [ + "signature" + ] + }, "SqlQueryCreate": { "properties": { "connection_name": { diff --git a/swift/looker/rtl/constants.swift b/swift/looker/rtl/constants.swift index 824ea57b0..22683c7eb 100644 --- a/swift/looker/rtl/constants.swift +++ b/swift/looker/rtl/constants.swift @@ -51,7 +51,7 @@ extension String { } public struct Constants { - public static let lookerVersion = "23.14" + public static let lookerVersion = "23.17" public static let apiVersion = "4.0" public static let defaultApiVersion = "4.0" // Swift requires API 4.0 public static let sdkVersion = #"\#(apiVersion).\#(lookerVersion)"# diff --git a/swift/looker/sdk/methods.swift b/swift/looker/sdk/methods.swift index 3428977d4..a8853f859 100644 --- a/swift/looker/sdk/methods.swift +++ b/swift/looker/sdk/methods.swift @@ -25,7 +25,7 @@ */ /** - * 461 API methods + * 464 API methods */ @@ -836,6 +836,23 @@ open class LookerSDK: APIMethods { return result } + /** + * ### Validate a Signed Embed URL + * + * GET /embed/sso/validate -> EmbedUrlResponse + */ + public func validate_embed_url( + /** + * @param {String} url URL to validate + */ + url: String? = nil, + options: ITransportSettings? = nil + ) -> SDKResponse { + let result: SDKResponse = self.get("/embed/sso/validate", + ["url": url], nil, options) + return result + } + /** * ### Acquire a cookieless embed session. * @@ -2015,19 +2032,19 @@ open class LookerSDK: APIMethods { */ sorts: String? = nil, /** - * @param {Int64} page The page to return. DEPRECATED. Use offset instead. + * @param {Int64} page DEPRECATED. Use limit and offset instead. Return only page N of paginated results */ page: Int64? = nil, /** - * @param {Int64} per_page The number of items in the returned page. DEPRECATED. Use limit instead. + * @param {Int64} per_page DEPRECATED. Use limit and offset instead. Return N rows of data per page */ per_page: Int64? = nil, /** - * @param {Int64} offset The number of items to skip before returning any. (used with limit and takes priority over page and per_page) + * @param {Int64} offset Number of results to return. (used with offset and takes priority over page and per_page) */ offset: Int64? = nil, /** - * @param {Int64} limit The maximum number of items to return. (used with offset and takes priority over page and per_page) + * @param {Int64} limit Number of results to skip before returning any. (used with limit and takes priority over page and per_page) */ limit: Int64? = nil, /** @@ -2986,7 +3003,10 @@ open class LookerSDK: APIMethods { /** * ### This feature is enabled only by special license. - * ### Gets the whitelabel configuration, which includes hiding documentation links, custom favicon uploading, etc. + * + * This endpoint provides the private label configuration, which includes hiding documentation links, custom favicon uploading, etc. + * + * This endpoint is deprecated. [Get Setting](#!/Config/get_setting) should be used to retrieve private label settings instead * * GET /whitelabel_configuration -> WhitelabelConfiguration */ @@ -3004,7 +3024,9 @@ open class LookerSDK: APIMethods { } /** - * ### Update the whitelabel configuration + * ### Update the private label configuration + * + * This endpoint is deprecated. [Set Setting](#!/Config/set_setting) should be used to update private label settings instead * * PUT /whitelabel_configuration -> WhitelabelConfiguration */ @@ -3810,11 +3832,11 @@ open class LookerSDK: APIMethods { */ offset: Int64? = nil, /** - * @param {Int64} page Requested page. + * @param {Int64} page DEPRECATED. Use limit and offset instead. Return only page N of paginated results */ page: Int64? = nil, /** - * @param {Int64} per_page Results per page. + * @param {Int64} per_page DEPRECATED. Use limit and offset instead. Return N rows of data per page */ per_page: Int64? = nil, options: ITransportSettings? = nil @@ -4124,7 +4146,7 @@ open class LookerSDK: APIMethods { */ content_favorite_id: String? = nil, /** - * @param {String} folder_id Filter on a particular space. + * @param {String} folder_id Filter on a particular folder. */ folder_id: String? = nil, /** @@ -5307,10 +5329,7 @@ open class LookerSDK: APIMethods { /** * ### Get information about all folders. * - * In API 3.x, this will not return empty personal folders, unless they belong to the calling user, - * or if they contain soft-deleted content. - * - * In API 4.0+, all personal folders will be returned. + * All personal folders will be returned. * * GET /folders -> [Folder] */ @@ -5463,7 +5482,6 @@ open class LookerSDK: APIMethods { /** * ### Get all looks in a folder. - * In API 3.x, this will return all looks in a folder, including looks in the trash. * In API 4.0+, all looks in a folder will be returned, excluding looks in the trash. * * GET /folders/{folder_id}/looks -> [LookWithQuery] @@ -6558,7 +6576,7 @@ open class LookerSDK: APIMethods { * * Soft-deleted looks are excluded from the results of [all_looks()](#!/Look/all_looks) and [search_looks()](#!/Look/search_looks), so they * essentially disappear from view even though they still reside in the db. - * In API 3.1 and later, you can pass `deleted: true` as a parameter to [search_looks()](#!/3.1/Look/search_looks) to list soft-deleted looks. + * You can pass `deleted: true` as a parameter to [search_looks()](#!/Look/search_looks) to list soft-deleted looks. * * NOTE: [delete_look()](#!/Look/delete_look) performs a "hard delete" - the look data is removed from the Looker * database and destroyed. There is no "undo" for `delete_look()`. @@ -6619,7 +6637,8 @@ open class LookerSDK: APIMethods { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -8300,7 +8319,8 @@ open class LookerSDK: APIMethods { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -8426,7 +8446,8 @@ open class LookerSDK: APIMethods { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -8523,7 +8544,7 @@ open class LookerSDK: APIMethods { * Here is an example inline query URL: * * ``` - * https://looker.mycompany.com:19999/api/3.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles + * https://looker.mycompany.com:19999/api/4.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles * ``` * * When invoking this endpoint with the Ruby SDK, pass the query parameter parts as a hash. The hash to match the above would look like: @@ -8549,7 +8570,8 @@ open class LookerSDK: APIMethods { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -8676,19 +8698,69 @@ open class LookerSDK: APIMethods { } /** - * Get a SQL Runner query. + * ### Run a saved SQL interface query. * - * GET /sql_queries/{slug} -> SqlQuery + * This runs a previously created SQL interface query. + * + * The 'result_format' parameter specifies the desired structure and format of the response. + * + * Supported formats: + * + * | result_format | Description + * | :-----------: | :--- | + * | json | Plain json + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | csv | Comma separated values with a header + * | txt | Tab separated values with a header + * | html | Simple html + * | md | Simple markdown + * | xlsx | MS Excel spreadsheet + * | sql | Returns the generated SQL rather than running the query + * | png | A PNG image of the visualization of the query + * | jpg | A JPG image of the visualization of the query + * + * GET /sql_interface_queries/{query_id}/run/{result_format} -> String + * + * **Note**: Binary content may be returned by this method. */ - public func sql_query( + public func run_sql_interface_query( /** - * @param {String} slug slug of query + * @param {Int64} query_id Integer id of query */ - _ slug: String, + _ query_id: Int64, + /** + * @param {String} result_format Format of result, options are: ["json_bi"] + */ + _ result_format: String, options: ITransportSettings? = nil - ) -> SDKResponse { - let path_slug = encodeParam(slug) - let result: SDKResponse = self.get("/sql_queries/\(path_slug)", nil, nil, options) + ) -> SDKResponse { + let path_query_id = encodeParam(query_id) + let path_result_format = encodeParam(result_format) + let result: SDKResponse = self.get("/sql_interface_queries/\(path_query_id)/run/\(path_result_format)", nil, nil, options) + return result + } + + /** + * ### Create a SQL interface query. + * + * This allows you to create a new SQL interface query that you can later run. Looker queries are immutable once created + * and are not deleted. If you create a query that is exactly like an existing query then the existing query + * will be returned and no new query will be created. Whether a new query is created or not, you can use + * the 'id' in the returned query with the 'run' method. + * + * The query parameters are passed as json in the body of the request. + * + * POST /sql_interface_queries -> SqlInterfaceQuery + */ + public func create_sql_interface_query( + /** + * @param {WriteSqlInterfaceQueryCreate} body + */ + _ body: WriteSqlInterfaceQueryCreate, + options: ITransportSettings? = nil + ) -> SDKResponse { + let result: SDKResponse = self.post("/sql_interface_queries", nil, try! self.encode(body), options) return result } @@ -8710,6 +8782,23 @@ open class LookerSDK: APIMethods { return result } + /** + * Get a SQL Runner query. + * + * GET /sql_queries/{slug} -> SqlQuery + */ + public func sql_query( + /** + * @param {String} slug slug of query + */ + _ slug: String, + options: ITransportSettings? = nil + ) -> SDKResponse { + let path_slug = encodeParam(slug) + let result: SDKResponse = self.get("/sql_queries/\(path_slug)", nil, nil, options) + return result + } + /** * Execute a SQL Runner query in a given result_format. * @@ -8867,12 +8956,16 @@ open class LookerSDK: APIMethods { * @param {Bool} long_tables Whether or not to expand table vis to full length */ long_tables: Bool? = nil, + /** + * @param {String} theme Theme to apply. Will render embedded version of dashboard if valid + */ + theme: String? = nil, options: ITransportSettings? = nil ) -> SDKResponse { let path_dashboard_id = encodeParam(dashboard_id) let path_result_format = encodeParam(result_format) let result: SDKResponse = self.post("/render_tasks/dashboards/\(path_dashboard_id)/\(path_result_format)", - ["width": width, "height": height, "fields": fields, "pdf_paper_size": pdf_paper_size, "pdf_landscape": pdf_landscape as Any?, "long_tables": long_tables as Any?], try! self.encode(body), options) + ["width": width, "height": height, "fields": fields, "pdf_paper_size": pdf_paper_size, "pdf_landscape": pdf_landscape as Any?, "long_tables": long_tables as Any?, "theme": theme], try! self.encode(body), options) return result } diff --git a/swift/looker/sdk/models.swift b/swift/looker/sdk/models.swift index ac2d43cb0..5f92eb39d 100644 --- a/swift/looker/sdk/models.swift +++ b/swift/looker/sdk/models.swift @@ -25,7 +25,7 @@ */ /** - * 329 API models: 247 Spec, 0 Request, 60 Write, 22 Enum + * 332 API models: 249 Spec, 0 Request, 61 Write, 22 Enum */ @@ -129,7 +129,7 @@ public struct Alert: SDKModel { private var _cron: AnyString /** - * Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals + * Vixie-Style crontab specification when to run. At minimum, it has to be longer than 15 minute intervals */ public var cron: String { get { _cron.value } @@ -7613,7 +7613,7 @@ public struct Dialect: SDKModel { } /** - * Suports streaming results (read-only) + * Supports streaming results (read-only) */ public var supports_streaming: Bool? @@ -10704,7 +10704,7 @@ public struct IntegrationRequiredField: SDKModel { private var _any_tag: [AnyString]? /** - * If present, supercedes 'tag' and matches a field that has any of the provided tags. (read-only) + * If present, supersedes 'tag' and matches a field that has any of the provided tags. (read-only) */ public var any_tag: [String]? { get { if let v = _any_tag { return v.map { $0.value } } else { return nil } } @@ -10713,7 +10713,7 @@ public struct IntegrationRequiredField: SDKModel { private var _all_tags: [AnyString]? /** - * If present, supercedes 'tag' and matches a field that has all of the provided tags. (read-only) + * If present, supersedes 'tag' and matches a field that has all of the provided tags. (read-only) */ public var all_tags: [String]? { get { if let v = _all_tags { return v.map { $0.value } } else { return nil } } @@ -16314,6 +16314,7 @@ public struct Project: SDKModel { case allow_warnings case is_example case _dependency_status = "dependency_status" + case _data_tests_count = "data_tests_count" } /** * Operations the current user is able to perform on this object (read-only) @@ -16477,7 +16478,16 @@ public struct Project: SDKModel { set { _dependency_status = newValue.map(AnyString.init) } } - public init(can: StringDictionary? = nil, id: String? = nil, name: String? = nil, uses_git: Bool? = nil, git_remote_url: String? = nil, git_username: String? = nil, git_password: String? = nil, git_production_branch_name: String? = nil, use_git_cookie_auth: Bool? = nil, git_username_user_attribute: String? = nil, git_password_user_attribute: String? = nil, git_service_name: String? = nil, git_application_server_http_port: Int64? = nil, git_application_server_http_scheme: String? = nil, deploy_secret: String? = nil, unset_deploy_secret: Bool? = nil, pull_request_mode: PullRequestMode? = nil, validation_required: Bool? = nil, git_release_mgmt_enabled: Bool? = nil, allow_warnings: Bool? = nil, is_example: Bool? = nil, dependency_status: String? = nil) { + private var _data_tests_count: AnyInt? + /** + * Number of data tests within project (read-only) + */ + public var data_tests_count: Int64? { + get { _data_tests_count?.value } + set { _data_tests_count = newValue.map(AnyInt.init) } + } + + public init(can: StringDictionary? = nil, id: String? = nil, name: String? = nil, uses_git: Bool? = nil, git_remote_url: String? = nil, git_username: String? = nil, git_password: String? = nil, git_production_branch_name: String? = nil, use_git_cookie_auth: Bool? = nil, git_username_user_attribute: String? = nil, git_password_user_attribute: String? = nil, git_service_name: String? = nil, git_application_server_http_port: Int64? = nil, git_application_server_http_scheme: String? = nil, deploy_secret: String? = nil, unset_deploy_secret: Bool? = nil, pull_request_mode: PullRequestMode? = nil, validation_required: Bool? = nil, git_release_mgmt_enabled: Bool? = nil, allow_warnings: Bool? = nil, is_example: Bool? = nil, dependency_status: String? = nil, data_tests_count: Int64? = nil) { self.can = can self._id = id.map(AnyString.init) self._name = name.map(AnyString.init) @@ -16500,6 +16510,7 @@ public struct Project: SDKModel { self.allow_warnings = allow_warnings self.is_example = is_example self._dependency_status = dependency_status.map(AnyString.init) + self._data_tests_count = data_tests_count.map(AnyInt.init) } } @@ -20201,6 +20212,86 @@ public struct Snippet: SDKModel { } +public struct SqlInterfaceQuery: SDKModel { + + private enum CodingKeys : String, CodingKey { + case can + case _id = "id" + case _signature = "signature" + } + /** + * Operations the current user is able to perform on this object (read-only) + */ + public var can: StringDictionary? + + private var _id: AnyInt? + /** + * Unique Id (read-only) + */ + public var id: Int64? { + get { _id?.value } + set { _id = newValue.map(AnyInt.init) } + } + + private var _signature: AnyString + /** + * Calcite signature (read-only) + */ + public var signature: String { + get { _signature.value } + set { _signature = AnyString.init(newValue) } + } + + public init(can: StringDictionary? = nil, id: Int64? = nil, signature: String) { + self.can = can + self._id = id.map(AnyInt.init) + self._signature = AnyString.init(signature) + } + + public init(can: StringDictionary? = nil, id: Int64? = nil, _ signature: String) { + self.init(can: can, id: id, signature: signature) + } + +} + +public struct SqlInterfaceQueryCreate: SDKModel { + + private enum CodingKeys : String, CodingKey { + case can + case _sql = "sql" + case jdbc_client + } + /** + * Operations the current user is able to perform on this object (read-only) + */ + public var can: StringDictionary? + + private var _sql: AnyString + /** + * Original SQL request + */ + public var sql: String { + get { _sql.value } + set { _sql = AnyString.init(newValue) } + } + + /** + * Whether the query should be run for use in a JDBC Client. This changes the formatting of some datetime based values. + */ + public var jdbc_client: Bool? + + public init(can: StringDictionary? = nil, sql: String, jdbc_client: Bool? = nil) { + self.can = can + self._sql = AnyString.init(sql) + self.jdbc_client = jdbc_client + } + + public init(can: StringDictionary? = nil, _ sql: String, jdbc_client: Bool? = nil) { + self.init(can: can, sql: sql, jdbc_client: jdbc_client) + } + +} + public struct SqlQuery: SDKModel { private enum CodingKeys : String, CodingKey { @@ -22691,7 +22782,7 @@ public struct WriteAlert: SDKModel { private var _cron: AnyString /** - * Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals + * Vixie-Style crontab specification when to run. At minimum, it has to be longer than 15 minute intervals */ public var cron: String { get { _cron.value } @@ -26393,7 +26484,7 @@ public struct WritePrivatelabelConfiguration: SDKModel { /** * Dynamic writeable type for Project removes: - * can, id, uses_git, is_example + * can, id, uses_git, is_example, data_tests_count */ public struct WriteProject: SDKModel { @@ -27629,6 +27720,41 @@ public struct WriteSetting: SDKModel { } +/** + * Dynamic writeable type for SqlInterfaceQueryCreate removes: + * can + */ +public struct WriteSqlInterfaceQueryCreate: SDKModel { + + private enum CodingKeys : String, CodingKey { + case _sql = "sql" + case jdbc_client + } + private var _sql: AnyString + /** + * Original SQL request + */ + public var sql: String { + get { _sql.value } + set { _sql = AnyString.init(newValue) } + } + + /** + * Whether the query should be run for use in a JDBC Client. This changes the formatting of some datetime based values. + */ + public var jdbc_client: Bool? + + public init(sql: String, jdbc_client: Bool? = nil) { + self._sql = AnyString.init(sql) + self.jdbc_client = jdbc_client + } + + public init(_ sql: String, jdbc_client: Bool? = nil) { + self.init(sql: sql, jdbc_client: jdbc_client) + } + +} + /** * Dynamic writeable type for SshServer removes: * ssh_server_id, finger_print, sha_finger_print, public_key, status diff --git a/swift/looker/sdk/streams.swift b/swift/looker/sdk/streams.swift index 1feeba2c2..4966a449d 100644 --- a/swift/looker/sdk/streams.swift +++ b/swift/looker/sdk/streams.swift @@ -25,7 +25,7 @@ */ /** - * 461 API methods + * 464 API methods */ @@ -834,6 +834,23 @@ open class LookerSDKStream: APIMethods { return result } + /** + * ### Validate a Signed Embed URL + * + * GET /embed/sso/validate -> EmbedUrlResponse + */ + public func validate_embed_url( + /** + * @param {String} url URL to validate + */ + url: String? = nil, + options: ITransportSettings? = nil + ) -> SDKResponse { + let result: SDKResponse = self.get("/embed/sso/validate", + ["url": url], nil, options) + return result + } + /** * ### Acquire a cookieless embed session. * @@ -2013,19 +2030,19 @@ open class LookerSDKStream: APIMethods { */ sorts: String? = nil, /** - * @param {Int64} page The page to return. DEPRECATED. Use offset instead. + * @param {Int64} page DEPRECATED. Use limit and offset instead. Return only page N of paginated results */ page: Int64? = nil, /** - * @param {Int64} per_page The number of items in the returned page. DEPRECATED. Use limit instead. + * @param {Int64} per_page DEPRECATED. Use limit and offset instead. Return N rows of data per page */ per_page: Int64? = nil, /** - * @param {Int64} offset The number of items to skip before returning any. (used with limit and takes priority over page and per_page) + * @param {Int64} offset Number of results to return. (used with offset and takes priority over page and per_page) */ offset: Int64? = nil, /** - * @param {Int64} limit The maximum number of items to return. (used with offset and takes priority over page and per_page) + * @param {Int64} limit Number of results to skip before returning any. (used with limit and takes priority over page and per_page) */ limit: Int64? = nil, /** @@ -2984,7 +3001,10 @@ open class LookerSDKStream: APIMethods { /** * ### This feature is enabled only by special license. - * ### Gets the whitelabel configuration, which includes hiding documentation links, custom favicon uploading, etc. + * + * This endpoint provides the private label configuration, which includes hiding documentation links, custom favicon uploading, etc. + * + * This endpoint is deprecated. [Get Setting](#!/Config/get_setting) should be used to retrieve private label settings instead * * GET /whitelabel_configuration -> WhitelabelConfiguration */ @@ -3002,7 +3022,9 @@ open class LookerSDKStream: APIMethods { } /** - * ### Update the whitelabel configuration + * ### Update the private label configuration + * + * This endpoint is deprecated. [Set Setting](#!/Config/set_setting) should be used to update private label settings instead * * PUT /whitelabel_configuration -> WhitelabelConfiguration */ @@ -3808,11 +3830,11 @@ open class LookerSDKStream: APIMethods { */ offset: Int64? = nil, /** - * @param {Int64} page Requested page. + * @param {Int64} page DEPRECATED. Use limit and offset instead. Return only page N of paginated results */ page: Int64? = nil, /** - * @param {Int64} per_page Results per page. + * @param {Int64} per_page DEPRECATED. Use limit and offset instead. Return N rows of data per page */ per_page: Int64? = nil, options: ITransportSettings? = nil @@ -4122,7 +4144,7 @@ open class LookerSDKStream: APIMethods { */ content_favorite_id: String? = nil, /** - * @param {String} folder_id Filter on a particular space. + * @param {String} folder_id Filter on a particular folder. */ folder_id: String? = nil, /** @@ -5305,10 +5327,7 @@ open class LookerSDKStream: APIMethods { /** * ### Get information about all folders. * - * In API 3.x, this will not return empty personal folders, unless they belong to the calling user, - * or if they contain soft-deleted content. - * - * In API 4.0+, all personal folders will be returned. + * All personal folders will be returned. * * GET /folders -> [Folder] */ @@ -5461,7 +5480,6 @@ open class LookerSDKStream: APIMethods { /** * ### Get all looks in a folder. - * In API 3.x, this will return all looks in a folder, including looks in the trash. * In API 4.0+, all looks in a folder will be returned, excluding looks in the trash. * * GET /folders/{folder_id}/looks -> [LookWithQuery] @@ -6556,7 +6574,7 @@ open class LookerSDKStream: APIMethods { * * Soft-deleted looks are excluded from the results of [all_looks()](#!/Look/all_looks) and [search_looks()](#!/Look/search_looks), so they * essentially disappear from view even though they still reside in the db. - * In API 3.1 and later, you can pass `deleted: true` as a parameter to [search_looks()](#!/3.1/Look/search_looks) to list soft-deleted looks. + * You can pass `deleted: true` as a parameter to [search_looks()](#!/Look/search_looks) to list soft-deleted looks. * * NOTE: [delete_look()](#!/Look/delete_look) performs a "hard delete" - the look data is removed from the Looker * database and destroyed. There is no "undo" for `delete_look()`. @@ -6617,7 +6635,8 @@ open class LookerSDKStream: APIMethods { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -8298,7 +8317,8 @@ open class LookerSDKStream: APIMethods { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -8424,7 +8444,8 @@ open class LookerSDKStream: APIMethods { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -8521,7 +8542,7 @@ open class LookerSDKStream: APIMethods { * Here is an example inline query URL: * * ``` - * https://looker.mycompany.com:19999/api/3.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles + * https://looker.mycompany.com:19999/api/4.0/queries/models/thelook/views/inventory_items/run/json?fields=category.name,inventory_items.days_in_inventory_tier,products.count&f[category.name]=socks&sorts=products.count+desc+0&limit=500&query_timezone=America/Los_Angeles * ``` * * When invoking this endpoint with the Ruby SDK, pass the query parameter parts as a hash. The hash to match the above would look like: @@ -8547,7 +8568,8 @@ open class LookerSDKStream: APIMethods { * | result_format | Description * | :-----------: | :--- | * | json | Plain json - * | json_detail | Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query * | csv | Comma separated values with a header * | txt | Tab separated values with a header * | html | Simple html @@ -8674,19 +8696,69 @@ open class LookerSDKStream: APIMethods { } /** - * Get a SQL Runner query. + * ### Run a saved SQL interface query. * - * GET /sql_queries/{slug} -> SqlQuery + * This runs a previously created SQL interface query. + * + * The 'result_format' parameter specifies the desired structure and format of the response. + * + * Supported formats: + * + * | result_format | Description + * | :-----------: | :--- | + * | json | Plain json + * | json_bi | (*RECOMMENDED*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | json_detail | (*LEGACY*) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query + * | csv | Comma separated values with a header + * | txt | Tab separated values with a header + * | html | Simple html + * | md | Simple markdown + * | xlsx | MS Excel spreadsheet + * | sql | Returns the generated SQL rather than running the query + * | png | A PNG image of the visualization of the query + * | jpg | A JPG image of the visualization of the query + * + * GET /sql_interface_queries/{query_id}/run/{result_format} -> String + * + * **Note**: Binary content may be returned by this method. */ - public func sql_query( + public func run_sql_interface_query( /** - * @param {String} slug slug of query + * @param {Int64} query_id Integer id of query */ - _ slug: String, + _ query_id: Int64, + /** + * @param {String} result_format Format of result, options are: ["json_bi"] + */ + _ result_format: String, options: ITransportSettings? = nil ) -> SDKResponse { - let path_slug = encodeParam(slug) - let result: SDKResponse = self.get("/sql_queries/\(path_slug)", nil, nil, options) + let path_query_id = encodeParam(query_id) + let path_result_format = encodeParam(result_format) + let result: SDKResponse = self.get("/sql_interface_queries/\(path_query_id)/run/\(path_result_format)", nil, nil, options) + return result + } + + /** + * ### Create a SQL interface query. + * + * This allows you to create a new SQL interface query that you can later run. Looker queries are immutable once created + * and are not deleted. If you create a query that is exactly like an existing query then the existing query + * will be returned and no new query will be created. Whether a new query is created or not, you can use + * the 'id' in the returned query with the 'run' method. + * + * The query parameters are passed as json in the body of the request. + * + * POST /sql_interface_queries -> SqlInterfaceQuery + */ + public func create_sql_interface_query( + /** + * @param {WriteSqlInterfaceQueryCreate} body + */ + _ body: WriteSqlInterfaceQueryCreate, + options: ITransportSettings? = nil + ) -> SDKResponse { + let result: SDKResponse = self.post("/sql_interface_queries", nil, try! self.encode(body), options) return result } @@ -8708,6 +8780,23 @@ open class LookerSDKStream: APIMethods { return result } + /** + * Get a SQL Runner query. + * + * GET /sql_queries/{slug} -> SqlQuery + */ + public func sql_query( + /** + * @param {String} slug slug of query + */ + _ slug: String, + options: ITransportSettings? = nil + ) -> SDKResponse { + let path_slug = encodeParam(slug) + let result: SDKResponse = self.get("/sql_queries/\(path_slug)", nil, nil, options) + return result + } + /** * Execute a SQL Runner query in a given result_format. * @@ -8865,12 +8954,16 @@ open class LookerSDKStream: APIMethods { * @param {Bool} long_tables Whether or not to expand table vis to full length */ long_tables: Bool? = nil, + /** + * @param {String} theme Theme to apply. Will render embedded version of dashboard if valid + */ + theme: String? = nil, options: ITransportSettings? = nil ) -> SDKResponse { let path_dashboard_id = encodeParam(dashboard_id) let path_result_format = encodeParam(result_format) let result: SDKResponse = self.post("/render_tasks/dashboards/\(path_dashboard_id)/\(path_result_format)", - ["width": width, "height": height, "fields": fields, "pdf_paper_size": pdf_paper_size, "pdf_landscape": pdf_landscape as Any?, "long_tables": long_tables as Any?], try! self.encode(body), options) + ["width": width, "height": height, "fields": fields, "pdf_paper_size": pdf_paper_size, "pdf_landscape": pdf_landscape as Any?, "long_tables": long_tables as Any?, "theme": theme], try! self.encode(body), options) return result }