Skip to content

Commit

Permalink
feat: generate SDKs for Looker 24.16 (#1499)
Browse files Browse the repository at this point in the history
Release-As: 24.16.0
  • Loading branch information
drstrangelooker authored Sep 11, 2024
1 parent bd34fa8 commit 109839d
Show file tree
Hide file tree
Showing 24 changed files with 1,485 additions and 102 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 = "24.14";
public const string LookerVersion = "24.16";

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

/// 465 API methods
/// 466 API methods

#nullable enable
using System;
Expand Down Expand Up @@ -3381,6 +3381,42 @@ public async Task<SdkResponse<ContentSearch[], Exception>> search_content(
{ "per_page", per_page }},null,options);
}

/// ### Get Content Summary
///
/// Retrieves a collection of content items related to user activity and engagement, such as recently viewed content,
/// favorites and scheduled items.
///
/// GET /content_summary -> ContentSummary[]
///
/// <returns><c>ContentSummary[]</c> Content Summary (application/json)</returns>
///
/// <param name="fields">Comma-delimited names of fields to return in responses. Omit for all 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="target_group_id">Match group id</param>
/// <param name="target_user_id">Match user id</param>
/// <param name="target_content_type">Content type to match, options are: look, dashboard. Can be provided as a comma delimited list.</param>
/// <param name="sorts">Fields to sort by</param>
public async Task<SdkResponse<ContentSummary[], Exception>> content_summary(
string? fields = null,
long? limit = null,
long? offset = null,
string? target_group_id = null,
string? target_user_id = null,
string? target_content_type = null,
string? sorts = null,
ITransportSettings? options = null)
{
return await AuthRequest<ContentSummary[], Exception>(HttpMethod.Get, "/content_summary", new Values {
{ "fields", fields },
{ "limit", limit },
{ "offset", offset },
{ "target_group_id", target_group_id },
{ "target_user_id", target_user_id },
{ "target_content_type", target_content_type },
{ "sorts", sorts }},null,options);
}

/// ### Get an image representing the contents of a dashboard or look.
///
/// The returned thumbnail is an abstract representation of the contents of a dashboard or look and does not
Expand Down
50 changes: 45 additions & 5 deletions csharp/sdk/4.0/models.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/// SOFTWARE.
///

/// 342 API models: 259 Spec, 0 Request, 61 Write, 22 Enum
/// 343 API models: 260 Spec, 0 Request, 61 Write, 22 Enum

#nullable enable
using System;
Expand Down Expand Up @@ -597,6 +597,46 @@ public class ContentSearch : SdkModel
public string? preferred_viewer { get; set; } = null;
}

public class ContentSummary : 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 string? id { get; set; } = null;
/// <summary>Content type (read-only)</summary>
public string? content_type { get; set; } = null;
/// <summary>Content id (read-only)</summary>
public string? content_id { get; set; } = null;
/// <summary>Content slug (read-only)</summary>
public string? content_slug { get; set; } = null;
/// <summary>Content title (read-only)</summary>
public string? title { get; set; } = null;
/// <summary>Content Description (read-only)</summary>
public string? description { get; set; } = null;
/// <summary>Last time viewed by current user (read-only)</summary>
public DateTime? last_viewed_at { get; set; } = null;
/// <summary>ID of user who created the content (read-only)</summary>
public string? user_id { get; set; } = null;
/// <summary>Full name of user who created the content (read-only)</summary>
public string? user_full_name { get; set; } = null;
/// <summary>If the content is scheduled by the current user (read-only)</summary>
public bool? is_scheduled { get; set; } = null;
/// <summary>Number of favorites (read-only)</summary>
public long? favorite_count { get; set; } = null;
/// <summary>Number of views (read-only)</summary>
public long? view_count { get; set; } = null;
/// <summary>Corresponding favorite id if item is favorited by current user (read-only)</summary>
public string? favorite_id { get; set; } = null;
/// <summary> (read-only)</summary>
public float? weighted_score { get; set; } = null;
/// <summary> (read-only)</summary>
public float? group_weighted_score { get; set; } = null;
/// <summary> (read-only)</summary>
public float? suggestion_score { get; set; } = null;
/// <summary>The preferred route for viewing this content (ie: dashboards or dashboards-next) (read-only)</summary>
public string? preferred_viewer { get; set; } = null;
}

public class ContentValidation : SdkModel
{
/// <summary>A list of content errors (read-only)</summary>
Expand Down Expand Up @@ -4747,8 +4787,6 @@ public class ScheduledPlan : SdkModel
public string? datagroup { get; set; } = null;
/// <summary>Timezone for interpreting the specified crontab (default is Looker instance timezone)</summary>
public string? timezone { get; set; } = null;
/// <summary>Query id</summary>
public string? query_id { get; set; } = null;
/// <summary>Scheduled plan destinations</summary>
public ScheduledPlanDestination[]? scheduled_plan_destination { get; set; } = null;
/// <summary>Whether the plan in question should only be run once (usually for testing)</summary>
Expand All @@ -4775,6 +4813,8 @@ public class ScheduledPlan : SdkModel
public bool? long_tables { get; set; } = null;
/// <summary>The pixel width at which we render the inline table visualizations</summary>
public long? inline_table_width { get; set; } = null;
/// <summary>Query id</summary>
public string? query_id { get; set; } = null;
/// <summary>Unique Id (read-only)</summary>
public string? id { get; set; } = null;
/// <summary>Date and time when ScheduledPlan was created (read-only)</summary>
Expand Down Expand Up @@ -6928,8 +6968,6 @@ public class WriteScheduledPlan : SdkModel
public string? datagroup { get; set; } = null;
/// <summary>Timezone for interpreting the specified crontab (default is Looker instance timezone)</summary>
public string? timezone { get; set; } = null;
/// <summary>Query id</summary>
public string? query_id { get; set; } = null;
/// <summary>Scheduled plan destinations</summary>
public ScheduledPlanDestination[]? scheduled_plan_destination { get; set; } = null;
/// <summary>Whether the plan in question should only be run once (usually for testing)</summary>
Expand All @@ -6956,6 +6994,8 @@ public class WriteScheduledPlan : SdkModel
public bool? long_tables { get; set; } = null;
/// <summary>The pixel width at which we render the inline table visualizations</summary>
public long? inline_table_width { get; set; } = null;
/// <summary>Query id</summary>
public string? query_id { get; set; } = null;
}

/// Dynamic writeable type for SessionConfig removes:
Expand Down
16 changes: 15 additions & 1 deletion go/sdk/v4/methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ SOFTWARE.

/*
465 API methods
466 API methods
*/

// NOTE: Do not edit this file generated by Looker SDK Codegen for API v4
Expand Down Expand Up @@ -2829,6 +2829,20 @@ func (l *LookerSDK) SearchContent(request RequestSearchContent,

}

// ### Get Content Summary
//
// Retrieves a collection of content items related to user activity and engagement, such as recently viewed content,
// favorites and scheduled items.
//
// GET /content_summary -> []ContentSummary
func (l *LookerSDK) ContentSummary(request RequestContentSummary,
options *rtl.ApiSettings) ([]ContentSummary, error) {
var result []ContentSummary
err := l.session.Do(&result, "GET", "/4.0", "/content_summary", map[string]interface{}{"fields": request.Fields, "limit": request.Limit, "offset": request.Offset, "target_group_id": request.TargetGroupId, "target_user_id": request.TargetUserId, "target_content_type": request.TargetContentType, "sorts": request.Sorts}, nil, options)
return result, err

}

// ### Get an image representing the contents of a dashboard or look.
//
// The returned thumbnail is an abstract representation of the contents of a dashboard or look and does not
Expand Down
38 changes: 35 additions & 3 deletions go/sdk/v4/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ SOFTWARE.

/*
408 API models: 259 Spec, 67 Request, 60 Write, 22 Enum
410 API models: 260 Spec, 68 Request, 60 Write, 22 Enum
*/

// NOTE: Do not edit this file generated by Looker SDK Codegen for API v4
Expand Down Expand Up @@ -347,6 +347,27 @@ type ContentSearch struct {
PreferredViewer *string `json:"preferred_viewer,omitempty"` // Preferred way of viewing the content (only applies to dashboards)
}

type ContentSummary struct {
Can *map[string]bool `json:"can,omitempty"` // Operations the current user is able to perform on this object
Id *string `json:"id,omitempty"` // Unique id
ContentType *string `json:"content_type,omitempty"` // Content type
ContentId *string `json:"content_id,omitempty"` // Content id
ContentSlug *string `json:"content_slug,omitempty"` // Content slug
Title *string `json:"title,omitempty"` // Content title
Description *string `json:"description,omitempty"` // Content Description
LastViewedAt *time.Time `json:"last_viewed_at,omitempty"` // Last time viewed by current user
UserId *string `json:"user_id,omitempty"` // ID of user who created the content
UserFullName *string `json:"user_full_name,omitempty"` // Full name of user who created the content
IsScheduled *bool `json:"is_scheduled,omitempty"` // If the content is scheduled by the current user
FavoriteCount *int64 `json:"favorite_count,omitempty"` // Number of favorites
ViewCount *int64 `json:"view_count,omitempty"` // Number of views
FavoriteId *string `json:"favorite_id,omitempty"` // Corresponding favorite id if item is favorited by current user
WeightedScore *float32 `json:"weighted_score,omitempty"`
GroupWeightedScore *float32 `json:"group_weighted_score,omitempty"`
SuggestionScore *float32 `json:"suggestion_score,omitempty"`
PreferredViewer *string `json:"preferred_viewer,omitempty"` // The preferred route for viewing this content (ie: dashboards or dashboards-next)
}

type ContentValidation struct {
ContentWithErrors *[]ContentValidatorError `json:"content_with_errors,omitempty"` // A list of content errors
ComputationTime *float32 `json:"computation_time,omitempty"` // Duration of content validation in seconds
Expand Down Expand Up @@ -2613,6 +2634,17 @@ type RequestConnectionTables struct {
TableLimit *int64 `json:"table_limit,omitempty"` // Optional. Return tables up to the table_limit
}

// Dynamically generated request type for content_summary
type RequestContentSummary struct {
Fields *string `json:"fields,omitempty"` // Comma-delimited names of fields to return in responses. Omit for all 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)
TargetGroupId *string `json:"target_group_id,omitempty"` // Match group id
TargetUserId *string `json:"target_user_id,omitempty"` // Match user id
TargetContentType *string `json:"target_content_type,omitempty"` // Content type to match, options are: look, dashboard. Can be provided as a comma delimited list.
Sorts *string `json:"sorts,omitempty"` // Fields to sort by
}

// Dynamically generated request type for content_thumbnail
type RequestContentThumbnail struct {
Type string `json:"type"` // Either dashboard or look
Expand Down Expand Up @@ -3380,7 +3412,6 @@ type ScheduledPlan struct {
Crontab *string `json:"crontab,omitempty"` // Vixie-Style crontab specification when to run
Datagroup *string `json:"datagroup,omitempty"` // Name of a datagroup; if specified will run when datagroup triggered (can't be used with cron string)
Timezone *string `json:"timezone,omitempty"` // Timezone for interpreting the specified crontab (default is Looker instance timezone)
QueryId *string `json:"query_id,omitempty"` // Query id
ScheduledPlanDestination *[]ScheduledPlanDestination `json:"scheduled_plan_destination,omitempty"` // Scheduled plan destinations
RunOnce *bool `json:"run_once,omitempty"` // Whether the plan in question should only be run once (usually for testing)
IncludeLinks *bool `json:"include_links,omitempty"` // Whether links back to Looker should be included in this ScheduledPlan
Expand All @@ -3394,6 +3425,7 @@ type ScheduledPlan struct {
ColorTheme *string `json:"color_theme,omitempty"` // Color scheme of the dashboard if applicable
LongTables *bool `json:"long_tables,omitempty"` // Whether or not to expand table vis to full length
InlineTableWidth *int64 `json:"inline_table_width,omitempty"` // The pixel width at which we render the inline table visualizations
QueryId *string `json:"query_id,omitempty"` // Query id
Id *string `json:"id,omitempty"` // Unique Id
CreatedAt *time.Time `json:"created_at,omitempty"` // Date and time when ScheduledPlan was created
UpdatedAt *time.Time `json:"updated_at,omitempty"` // Date and time when ScheduledPlan was last updated
Expand Down Expand Up @@ -4620,7 +4652,6 @@ type WriteScheduledPlan struct {
Crontab *string `json:"crontab,omitempty"` // Vixie-Style crontab specification when to run
Datagroup *string `json:"datagroup,omitempty"` // Name of a datagroup; if specified will run when datagroup triggered (can't be used with cron string)
Timezone *string `json:"timezone,omitempty"` // Timezone for interpreting the specified crontab (default is Looker instance timezone)
QueryId *string `json:"query_id,omitempty"` // Query id
ScheduledPlanDestination *[]ScheduledPlanDestination `json:"scheduled_plan_destination,omitempty"` // Scheduled plan destinations
RunOnce *bool `json:"run_once,omitempty"` // Whether the plan in question should only be run once (usually for testing)
IncludeLinks *bool `json:"include_links,omitempty"` // Whether links back to Looker should be included in this ScheduledPlan
Expand All @@ -4634,6 +4665,7 @@ type WriteScheduledPlan struct {
ColorTheme *string `json:"color_theme,omitempty"` // Color scheme of the dashboard if applicable
LongTables *bool `json:"long_tables,omitempty"` // Whether or not to expand table vis to full length
InlineTableWidth *int64 `json:"inline_table_width,omitempty"` // The pixel width at which we render the inline table visualizations
QueryId *string `json:"query_id,omitempty"` // Query id
}

// Dynamic writeable type for SessionConfig removes:
Expand Down
41 changes: 40 additions & 1 deletion kotlin/src/main/com/looker/sdk/4.0/methods.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/

/**
* 465 API methods
* 466 API methods
*/

// NOTE: Do not edit this file generated by Looker SDK Codegen for API 4.0
Expand Down Expand Up @@ -3396,6 +3396,45 @@ class LookerSDK(authSession: AuthSession) : APIMethods(authSession) {
)
}

/**
* ### Get Content Summary
*
* Retrieves a collection of content items related to user activity and engagement, such as recently viewed content,
* favorites and scheduled items.
*
* @param {String} fields Comma-delimited names of fields to return in responses. Omit for all fields
* @param {Long} limit Number of results to return. (used with offset)
* @param {Long} offset Number of results to skip before returning any. (used with limit)
* @param {String} target_group_id Match group id
* @param {String} target_user_id Match user id
* @param {String} target_content_type Content type to match, options are: look, dashboard. Can be provided as a comma delimited list.
* @param {String} sorts Fields to sort by
*
* GET /content_summary -> Array<ContentSummary>
*/
@JvmOverloads fun content_summary(
fields: String? = null,
limit: Long? = null,
offset: Long? = null,
target_group_id: String? = null,
target_user_id: String? = null,
target_content_type: String? = null,
sorts: String? = null,
): SDKResponse {
return this.get<Array<ContentSummary>>(
"/content_summary",
mapOf(
"fields" to fields,
"limit" to limit,
"offset" to offset,
"target_group_id" to target_group_id,
"target_user_id" to target_user_id,
"target_content_type" to target_content_type,
"sorts" to sorts,
),
)
}

/**
* ### Get an image representing the contents of a dashboard or look.
*
Expand Down
Loading

0 comments on commit 109839d

Please sign in to comment.