Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: generate SDKs for Looker 23.16 #1365

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion csharp/rtl/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
153 changes: 120 additions & 33 deletions csharp/sdk/4.0/methods.cs

Large diffs are not rendered by default.

46 changes: 39 additions & 7 deletions csharp/sdk/4.0/models.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -58,7 +58,7 @@ public class Alert : SdkModel
/// <summary>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".</summary>
[JsonConverter(typeof(StringEnumConverter))]
public ComparisonType comparison_type { get; set; }
/// <summary>Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals</summary>
/// <summary>Vixie-Style crontab specification when to run. At minimum, it has to be longer than 15 minute intervals</summary>
public string cron { get; set; } = "";
/// <summary>Domain for the custom url selected by the alert creator from the admin defined domain allowlist</summary>
public string? custom_url_base { get; set; } = null;
Expand Down Expand Up @@ -1811,7 +1811,7 @@ public class Dialect : SdkModel
public string? persistent_table_sortkeys { get; set; } = null;
/// <summary>PDT distkey column (read-only)</summary>
public string? persistent_table_distkey { get; set; } = null;
/// <summary>Suports streaming results (read-only)</summary>
/// <summary>Supports streaming results (read-only)</summary>
public bool? supports_streaming { get; set; } = null;
/// <summary>Should SQL Runner snippets automatically be run (read-only)</summary>
public bool? automatically_run_sql_runner_snippets { get; set; } = null;
Expand Down Expand Up @@ -2565,9 +2565,9 @@ public class IntegrationRequiredField : SdkModel
{
/// <summary>Matches a field that has this tag. (read-only)</summary>
public string? tag { get; set; } = null;
/// <summary>If present, supercedes 'tag' and matches a field that has any of the provided tags. (read-only)</summary>
/// <summary>If present, supersedes 'tag' and matches a field that has any of the provided tags. (read-only)</summary>
public string[]? any_tag { get; set; } = null;
/// <summary>If present, supercedes 'tag' and matches a field that has all of the provided tags. (read-only)</summary>
/// <summary>If present, supersedes 'tag' and matches a field that has all of the provided tags. (read-only)</summary>
public string[]? all_tags { get; set; } = null;
}

Expand Down Expand Up @@ -3970,6 +3970,8 @@ public class Project : SdkModel
public bool? is_example { get; set; } = null;
/// <summary>Status of dependencies in your manifest & lockfile</summary>
public string? dependency_status { get; set; } = null;
/// <summary>Number of data tests within project (read-only)</summary>
public long? data_tests_count { get; set; } = null;
}

public class ProjectError : SdkModel
Expand Down Expand Up @@ -4858,6 +4860,26 @@ public class Snippet : SdkModel
public string? sql { get; set; } = null;
}

public class SqlInterfaceQuery : SdkModel
{
/// <summary>Operations the current user is able to perform on this object (read-only)</summary>
public StringDictionary<bool>? can { get; set; } = null;
/// <summary>Unique Id (read-only)</summary>
public long? id { get; set; } = null;
/// <summary>Calcite signature (read-only)</summary>
public string signature { get; set; } = "";
}

public class SqlInterfaceQueryCreate : SdkModel
{
/// <summary>Operations the current user is able to perform on this object (read-only)</summary>
public StringDictionary<bool>? can { get; set; } = null;
/// <summary>Original SQL request</summary>
public string sql { get; set; } = "";
/// <summary>Whether the query should be run for use in a JDBC Client. This changes the formatting of some datetime based values.</summary>
public bool? jdbc_client { get; set; } = null;
}

public class SqlQuery : SdkModel
{
/// <summary>Operations the current user is able to perform on this object (read-only)</summary>
Expand Down Expand Up @@ -5534,7 +5556,7 @@ public class WriteAlert : SdkModel
/// <summary>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".</summary>
[JsonConverter(typeof(StringEnumConverter))]
public ComparisonType comparison_type { get; set; }
/// <summary>Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals</summary>
/// <summary>Vixie-Style crontab specification when to run. At minimum, it has to be longer than 15 minute intervals</summary>
public string cron { get; set; } = "";
/// <summary>Domain for the custom url selected by the alert creator from the admin defined domain allowlist</summary>
public string? custom_url_base { get; set; } = null;
Expand Down Expand Up @@ -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
{
/// <summary>Project display name</summary>
Expand Down Expand Up @@ -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
{
/// <summary>Original SQL request</summary>
public string sql { get; set; } = "";
/// <summary>Whether the query should be run for use in a JDBC Client. This changes the formatting of some datetime based values.</summary>
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
Expand Down
118 changes: 95 additions & 23 deletions go/sdk/v4/methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
//
Expand All @@ -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
//
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()`.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

}
Expand All @@ -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
Expand Down Expand Up @@ -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

}
Expand Down
Loading
Loading