Skip to content

Commit

Permalink
feat: Looker 21.12 bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldodge79 committed Aug 4, 2021
1 parent 6f4f064 commit 72d6ecf
Show file tree
Hide file tree
Showing 23 changed files with 1,359 additions and 44 deletions.
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 = "21.10";
public const string LookerVersion = "21.12";

public const string Bearer = "Bearer";
public const string LookerAppiId = "x-looker-appid";
Expand Down
87 changes: 85 additions & 2 deletions csharp/sdk/4.0/methods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/// SOFTWARE.
///

/// 413 API methods
/// 415 API methods

#nullable enable
using System;
Expand Down Expand Up @@ -1696,6 +1696,24 @@ public async Task<SdkResponse<MobileSettings, Exception>> mobile_settings(
return await AuthRequest<MobileSettings, Exception>(HttpMethod.Get, "/mobile/settings", null,null,options);
}

/// ### Configure Looker Settings
///
/// Available settings are:
/// - extension_framework_enabled
/// - marketplace_auto_install_enabled
/// - marketplace_enabled
///
/// PATCH /setting -> Setting
///
/// <returns><c>Setting</c> Looker Settings (application/json)</returns>
///
public async Task<SdkResponse<Setting, Exception>> set_setting(
Setting body,
ITransportSettings? options = null)
{
return await AuthRequest<Setting, Exception>(HttpMethod.Patch, "/setting", null,body,options);
}

/// ### Get a list of timezones that Looker supports (e.g. useful for scheduling tasks).
///
/// GET /timezones -> Timezone[]
Expand Down Expand Up @@ -4636,12 +4654,18 @@ public async Task<SdkResponse<DependencyGraph, Exception>> graph_derived_tables_
/// <returns><c>LookmlModel[]</c> LookML Model (application/json)</returns>
///
/// <param name="fields">Requested fields.</param>
/// <param name="limit">Number of results to return. (can be used with offset)</param>
/// <param name="offset">Number of results to skip before returning any. (Defaults to 0 if not set when limit is used)</param>
public async Task<SdkResponse<LookmlModel[], Exception>> all_lookml_models(
string? fields = null,
long? limit = null,
long? offset = null,
ITransportSettings? options = null)
{
return await AuthRequest<LookmlModel[], Exception>(HttpMethod.Get, "/lookml_models", new Values {
{ "fields", fields }},null,options);
{ "fields", fields },
{ "limit", limit },
{ "offset", offset }},null,options);
}

/// ### Create a lookml model using the specified configuration.
Expand Down Expand Up @@ -7817,6 +7841,65 @@ public async Task<SdkResponse<string, Exception>> delete_theme(

#region User: Manage Users

/// ### Search email credentials
///
/// Returns all credentials_email records that match the given search criteria.
///
/// If multiple search params are given and `filter_or` is FALSE or not specified,
/// search params are combined in a logical AND operation.
/// Only rows that match *all* search param criteria will be returned.
///
/// If `filter_or` is TRUE, multiple search params are combined in a logical OR operation.
/// Results will include rows that match **any** of the search criteria.
///
/// String search params use case-insensitive matching.
/// String search params can contain `%` and '_' as SQL LIKE pattern match wildcard expressions.
/// example="dan%" will match "danger" and "Danzig" but not "David"
/// example="D_m%" will match "Damage" and "dump"
///
/// Integer search params can accept a single value or a comma separated list of values. The multiple
/// values will be combined under a logical OR operation - results will match at least one of
/// the given values.
///
/// Most search params can accept "IS NULL" and "NOT NULL" as special expressions to match
/// or exclude (respectively) rows where the column is null.
///
/// Boolean search params accept only "true" and "false" as values.
///
/// GET /credentials_email/search -> CredentialsEmailSearch[]
///
/// <returns><c>CredentialsEmailSearch[]</c> Credentials Email (application/json)</returns>
///
/// <param name="fields">Requested fields.</param>
/// <param name="limit">Number of results to return (used with `offset`).</param>
/// <param name="offset">Number of results to skip before returning any (used with `limit`).</param>
/// <param name="sorts">Fields to sort by.</param>
/// <param name="id">Match credentials_email id.</param>
/// <param name="email">Match credentials_email email.</param>
/// <param name="emails">Find credentials_email that match given emails.</param>
/// <param name="filter_or">Combine given search criteria in a boolean OR expression.</param>
public async Task<SdkResponse<CredentialsEmailSearch[], Exception>> search_credentials_email(
string? fields = null,
long? limit = null,
long? offset = null,
string? sorts = null,
long? id = null,
string? email = null,
string? emails = null,
bool? filter_or = null,
ITransportSettings? options = null)
{
return await AuthRequest<CredentialsEmailSearch[], Exception>(HttpMethod.Get, "/credentials_email/search", new Values {
{ "fields", fields },
{ "limit", limit },
{ "offset", offset },
{ "sorts", sorts },
{ "id", id },
{ "email", email },
{ "emails", emails },
{ "filter_or", filter_or }},null,options);
}

/// ### Get information about the current user; i.e. the user account currently calling the API.
///
/// GET /user -> User
Expand Down
37 changes: 36 additions & 1 deletion csharp/sdk/4.0/models.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/// SOFTWARE.
///

/// 284 API models: 211 Spec, 0 Request, 56 Write, 17 Enum
/// 286 API models: 213 Spec, 0 Request, 56 Write, 17 Enum

#nullable enable
using System;
Expand Down Expand Up @@ -735,6 +735,30 @@ public class CredentialsEmail : SdkModel
public string? user_url { get; set; } = null;
}

public class CredentialsEmailSearch : SdkModel
{
/// <summary>Operations the current user is able to perform on this object (read-only)</summary>
public StringDictionary<bool>? can { get; set; } = null;
/// <summary>Timestamp for the creation of this credential (read-only)</summary>
public string? created_at { get; set; } = null;
/// <summary>EMail address used for user login</summary>
public string? email { get; set; } = null;
/// <summary>Force the user to change their password upon their next login</summary>
public bool? forced_password_reset_at_next_login { get; set; } = null;
/// <summary>Has this credential been disabled? (read-only)</summary>
public bool? is_disabled { get; set; } = null;
/// <summary>Timestamp for most recent login using credential (read-only)</summary>
public string? logged_in_at { get; set; } = null;
/// <summary>Url with one-time use secret token that the user can use to reset password (read-only)</summary>
public string? password_reset_url { get; set; } = null;
/// <summary>Short name for the type of this kind of credential (read-only)</summary>
public string? type { get; set; } = null;
/// <summary>Link to get this item (read-only)</summary>
public string? url { get; set; } = null;
/// <summary>Link to get this user (read-only)</summary>
public string? user_url { get; set; } = null;
}

public class CredentialsEmbed : SdkModel
{
/// <summary>Operations the current user is able to perform on this object (read-only)</summary>
Expand Down Expand Up @@ -4151,6 +4175,17 @@ public class SessionConfig : SdkModel
public bool? track_session_location { get; set; } = null;
}

/// WARNING: no writeable properties found for POST, PUT, or PATCH
public class Setting : SdkModel
{
/// <summary>Toggle extension framework on or off (read-only)</summary>
public bool? extension_framework_enabled { get; set; } = null;
/// <summary>Toggle marketplace auto install on or off (read-only)</summary>
public bool? marketplace_auto_install_enabled { get; set; } = null;
/// <summary>Toggle marketplace on or off (read-only)</summary>
public bool? marketplace_enabled { get; set; } = null;
}

public class Snippet : SdkModel
{
/// <summary>Name of the snippet (read-only)</summary>
Expand Down
58 changes: 54 additions & 4 deletions go/sdk/v4/methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ SOFTWARE.

/*
413 API methods
415 API methods
*/


Expand Down Expand Up @@ -1444,6 +1444,23 @@ func (l *LookerSDK) MobileSettings(

}

// ### Configure Looker Settings
//
// Available settings are:
// - extension_framework_enabled
// - marketplace_auto_install_enabled
// - marketplace_enabled
//
// PATCH /setting -> Setting
func (l *LookerSDK) SetSetting(
body Setting,
options *rtl.ApiSettings) (Setting, error) {
var result Setting
err := l.session.Do(&result, "PATCH", "/4.0", "/setting", nil, body, options)
return result, err

}

// ### Get a list of timezones that Looker supports (e.g. useful for scheduling tasks).
//
// GET /timezones -> []Timezone
Expand Down Expand Up @@ -3563,11 +3580,10 @@ func (l *LookerSDK) GraphDerivedTablesForModel(request RequestGraphDerivedTables
// ### Get information about all lookml models.
//
// GET /lookml_models -> []LookmlModel
func (l *LookerSDK) AllLookmlModels(
fields string,
func (l *LookerSDK) AllLookmlModels(request RequestAllLookmlModels,
options *rtl.ApiSettings) ([]LookmlModel, error) {
var result []LookmlModel
err := l.session.Do(&result, "GET", "/4.0", "/lookml_models", map[string]interface{}{"fields": fields}, nil, options)
err := l.session.Do(&result, "GET", "/4.0", "/lookml_models", map[string]interface{}{"fields": request.Fields, "limit": request.Limit, "offset": request.Offset}, nil, options)
return result, err

}
Expand Down Expand Up @@ -5972,6 +5988,40 @@ func (l *LookerSDK) DeleteTheme(

// region User: Manage Users

// ### Search email credentials
//
// Returns all credentials_email records that match the given search criteria.
//
// If multiple search params are given and `filter_or` is FALSE or not specified,
// search params are combined in a logical AND operation.
// Only rows that match *all* search param criteria will be returned.
//
// If `filter_or` is TRUE, multiple search params are combined in a logical OR operation.
// Results will include rows that match **any** of the search criteria.
//
// String search params use case-insensitive matching.
// String search params can contain `%` and '_' as SQL LIKE pattern match wildcard expressions.
// example="dan%" will match "danger" and "Danzig" but not "David"
// example="D_m%" will match "Damage" and "dump"
//
// Integer search params can accept a single value or a comma separated list of values. The multiple
// values will be combined under a logical OR operation - results will match at least one of
// the given values.
//
// Most search params can accept "IS NULL" and "NOT NULL" as special expressions to match
// or exclude (respectively) rows where the column is null.
//
// Boolean search params accept only "true" and "false" as values.
//
// GET /credentials_email/search -> []CredentialsEmailSearch
func (l *LookerSDK) SearchCredentialsEmail(request RequestSearchCredentialsEmail,
options *rtl.ApiSettings) ([]CredentialsEmailSearch, error) {
var result []CredentialsEmailSearch
err := l.session.Do(&result, "GET", "/4.0", "/credentials_email/search", map[string]interface{}{"fields": request.Fields, "limit": request.Limit, "offset": request.Offset, "sorts": request.Sorts, "id": request.Id, "email": request.Email, "emails": request.Emails, "filter_or": request.FilterOr}, nil, options)
return result, err

}

// ### Get information about the current user; i.e. the user account currently calling the API.
//
// GET /user -> User
Expand Down
42 changes: 41 additions & 1 deletion go/sdk/v4/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ SOFTWARE.

/*
335 API models: 211 Spec, 51 Request, 56 Write, 17 Enum
339 API models: 213 Spec, 53 Request, 56 Write, 17 Enum
*/


Expand Down Expand Up @@ -478,6 +478,20 @@ type CredentialsEmail struct {
}


type CredentialsEmailSearch struct {
Can *map[string]bool `json:"can,omitempty"` // Operations the current user is able to perform on this object
CreatedAt *string `json:"created_at,omitempty"` // Timestamp for the creation of this credential
Email *string `json:"email,omitempty"` // EMail address used for user login
ForcedPasswordResetAtNextLogin *bool `json:"forced_password_reset_at_next_login,omitempty"` // Force the user to change their password upon their next login
IsDisabled *bool `json:"is_disabled,omitempty"` // Has this credential been disabled?
LoggedInAt *string `json:"logged_in_at,omitempty"` // Timestamp for most recent login using credential
PasswordResetUrl *string `json:"password_reset_url,omitempty"` // Url with one-time use secret token that the user can use to reset password
Type *string `json:"type,omitempty"` // Short name for the type of this kind of credential
Url *string `json:"url,omitempty"` // Link to get this item
UserUrl *string `json:"user_url,omitempty"` // Link to get this user
}


type CredentialsEmbed struct {
Can *map[string]bool `json:"can,omitempty"` // Operations the current user is able to perform on this object
CreatedAt *string `json:"created_at,omitempty"` // Timestamp for the creation of this credential
Expand Down Expand Up @@ -2252,6 +2266,13 @@ type RequestAllIntegrations struct {
IntegrationHubId *string `json:"integration_hub_id,omitempty"` // Filter to a specific provider
}

// Dynamically generated request type for all_lookml_models
type RequestAllLookmlModels struct {
Fields *string `json:"fields,omitempty"` // Requested fields.
Limit *int64 `json:"limit,omitempty"` // Number of results to return. (can be used with offset)
Offset *int64 `json:"offset,omitempty"` // Number of results to skip before returning any. (Defaults to 0 if not set when limit is used)
}

// Dynamically generated request type for all_roles
type RequestAllRoles struct {
Fields *string `json:"fields,omitempty"` // Requested fields.
Expand Down Expand Up @@ -2560,6 +2581,18 @@ type RequestSearchContentViews struct {
FilterOr *bool `json:"filter_or,omitempty"` // Combine given search criteria in a boolean OR expression
}

// Dynamically generated request type for search_credentials_email
type RequestSearchCredentialsEmail struct {
Fields *string `json:"fields,omitempty"` // Requested fields.
Limit *int64 `json:"limit,omitempty"` // Number of results to return (used with `offset`).
Offset *int64 `json:"offset,omitempty"` // Number of results to skip before returning any (used with `limit`).
Sorts *string `json:"sorts,omitempty"` // Fields to sort by.
Id *int64 `json:"id,omitempty"` // Match credentials_email id.
Email *string `json:"email,omitempty"` // Match credentials_email email.
Emails *string `json:"emails,omitempty"` // Find credentials_email that match given emails.
FilterOr *bool `json:"filter_or,omitempty"` // Combine given search criteria in a boolean OR expression.
}

// Dynamically generated request type for search_dashboard_elements
type RequestSearchDashboardElements struct {
DashboardId *int64 `json:"dashboard_id,omitempty"` // Select elements that refer to a given dashboard id
Expand Down Expand Up @@ -3055,6 +3088,13 @@ type SessionConfig struct {
TrackSessionLocation *bool `json:"track_session_location,omitempty"` // Track location of session when user logs in.
}

// WARNING: no writeable properties found for POST, PUT, or PATCH
type Setting struct {
ExtensionFrameworkEnabled *bool `json:"extension_framework_enabled,omitempty"` // Toggle extension framework on or off
MarketplaceAutoInstallEnabled *bool `json:"marketplace_auto_install_enabled,omitempty"` // Toggle marketplace auto install on or off
MarketplaceEnabled *bool `json:"marketplace_enabled,omitempty"` // Toggle marketplace on or off
}


type Snippet struct {
Name *string `json:"name,omitempty"` // Name of the snippet
Expand Down
Loading

0 comments on commit 72d6ecf

Please sign in to comment.