Skip to content

Ojongerius/graph #100

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

Merged
merged 2 commits into from
Feb 20, 2017
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
50 changes: 26 additions & 24 deletions dashboards.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,32 +62,34 @@ type Style struct {
PaletteFlip *bool `json:"paletteFlip,omitempty"`
}

type GraphDefinition struct {
Viz *string `json:"viz,omitempty"`
Requests []GraphDefinitionRequest `json:"requests,omitempty"`
Events []GraphEvent `json:"events,omitempty"`
Markers []GraphDefinitionMarker `json:"markers,omitempty"`

// For timeseries type graphs
Yaxis Yaxis `json:"yaxis,omitempty"`

// For query value type graphs
Autoscale *bool `json:"austoscale,omitempty"`
TextAlign *string `json:"text_align,omitempty"`
Precision *string `json:"precision,omitempty"`
CustomUnit *string `json:"custom_unit,omitempty"`

// For hostname type graphs
Style *Style `json:"Style,omitempty"`

Groups []string `json:"group,omitempty"`
IncludeNoMetricHosts *bool `json:"noMetricHosts,omitempty"`
Scopes []string `json:"scope,omitempty"`
IncludeUngroupedHosts *bool `json:"noGroupHosts,omitempty"`
}

// Graph represents a graph that might exist on a dashboard.
type Graph struct {
Title *string `json:"title,omitempty"`
Definition struct {
Viz *string `json:"viz,omitempty"`
Requests []GraphDefinitionRequest `json:"requests,omitempty"`
Events []GraphEvent `json:"events,omitempty"`
Markers []GraphDefinitionMarker `json:"markers,omitempty"`

// For timeseries type graphs
Yaxis Yaxis `json:"yaxis,omitempty"`

// For query value type graphs
Autoscale *bool `json:"austoscale,omitempty"`
TextAlign *string `json:"text_align,omitempty"`
Precision *string `json:"precision,omitempty"`
CustomUnit *string `json:"custom_unit,omitempty"`

// For hostname type graphs
Style *Style `json:"Style,omitempty"`

Groups []string `json:"group,omitempty"`
IncludeNoMetricHosts *bool `json:"noMetricHosts,omitempty"`
Scopes []string `json:"scope,omitempty"`
IncludeUngroupedHosts *bool `json:"noGroupHosts,omitempty"`
} `json:"definition"`
Title *string `json:"title,omitempty"`
Definition *GraphDefinition `json:"definition"`
}

// Template variable represents a template variable that might exist on a dashboard
Expand Down
279 changes: 279 additions & 0 deletions datadog-accessors.go
Original file line number Diff line number Diff line change
Expand Up @@ -4601,6 +4601,37 @@ func (f *FreeTextWidget) SetY(v int) {
f.Y = &v
}

// GetDefinition returns the Definition field if non-nil, zero value otherwise.
func (g *Graph) GetDefinition() GraphDefinition {
if g == nil || g.Definition == nil {
return GraphDefinition{}
}
return *g.Definition
}

// GetOkDefinition returns a tuple with the Definition field if it's non-nil, zero value otherwise
// and a boolean to check if the value has been set.
func (g *Graph) GetDefinitionOk() (GraphDefinition, bool) {
if g == nil || g.Definition == nil {
return GraphDefinition{}, false
}
return *g.Definition, true
}

// HasDefinition returns a boolean if a field has been set.
func (g *Graph) HasDefinition() bool {
if g != nil && g.Definition != nil {
return true
}

return false
}

// GetDefinition allocates a new g.Definition and returns the pointer to it.
func (g *Graph) SetDefinition(v GraphDefinition) {
g.Definition = &v
}

// GetTitle returns the Title field if non-nil, zero value otherwise.
func (g *Graph) GetTitle() string {
if g == nil || g.Title == nil {
Expand Down Expand Up @@ -4632,6 +4663,254 @@ func (g *Graph) SetTitle(v string) {
g.Title = &v
}

// GetAutoscale returns the Autoscale field if non-nil, zero value otherwise.
func (g *GraphDefinition) GetAutoscale() bool {
if g == nil || g.Autoscale == nil {
return false
}
return *g.Autoscale
}

// GetOkAutoscale returns a tuple with the Autoscale field if it's non-nil, zero value otherwise
// and a boolean to check if the value has been set.
func (g *GraphDefinition) GetAutoscaleOk() (bool, bool) {
if g == nil || g.Autoscale == nil {
return false, false
}
return *g.Autoscale, true
}

// HasAutoscale returns a boolean if a field has been set.
func (g *GraphDefinition) HasAutoscale() bool {
if g != nil && g.Autoscale != nil {
return true
}

return false
}

// GetAutoscale allocates a new g.Autoscale and returns the pointer to it.
func (g *GraphDefinition) SetAutoscale(v bool) {
g.Autoscale = &v
}

// GetCustomUnit returns the CustomUnit field if non-nil, zero value otherwise.
func (g *GraphDefinition) GetCustomUnit() string {
if g == nil || g.CustomUnit == nil {
return ""
}
return *g.CustomUnit
}

// GetOkCustomUnit returns a tuple with the CustomUnit field if it's non-nil, zero value otherwise
// and a boolean to check if the value has been set.
func (g *GraphDefinition) GetCustomUnitOk() (string, bool) {
if g == nil || g.CustomUnit == nil {
return "", false
}
return *g.CustomUnit, true
}

// HasCustomUnit returns a boolean if a field has been set.
func (g *GraphDefinition) HasCustomUnit() bool {
if g != nil && g.CustomUnit != nil {
return true
}

return false
}

// GetCustomUnit allocates a new g.CustomUnit and returns the pointer to it.
func (g *GraphDefinition) SetCustomUnit(v string) {
g.CustomUnit = &v
}

// GetIncludeNoMetricHosts returns the IncludeNoMetricHosts field if non-nil, zero value otherwise.
func (g *GraphDefinition) GetIncludeNoMetricHosts() bool {
if g == nil || g.IncludeNoMetricHosts == nil {
return false
}
return *g.IncludeNoMetricHosts
}

// GetOkIncludeNoMetricHosts returns a tuple with the IncludeNoMetricHosts field if it's non-nil, zero value otherwise
// and a boolean to check if the value has been set.
func (g *GraphDefinition) GetIncludeNoMetricHostsOk() (bool, bool) {
if g == nil || g.IncludeNoMetricHosts == nil {
return false, false
}
return *g.IncludeNoMetricHosts, true
}

// HasIncludeNoMetricHosts returns a boolean if a field has been set.
func (g *GraphDefinition) HasIncludeNoMetricHosts() bool {
if g != nil && g.IncludeNoMetricHosts != nil {
return true
}

return false
}

// GetIncludeNoMetricHosts allocates a new g.IncludeNoMetricHosts and returns the pointer to it.
func (g *GraphDefinition) SetIncludeNoMetricHosts(v bool) {
g.IncludeNoMetricHosts = &v
}

// GetIncludeUngroupedHosts returns the IncludeUngroupedHosts field if non-nil, zero value otherwise.
func (g *GraphDefinition) GetIncludeUngroupedHosts() bool {
if g == nil || g.IncludeUngroupedHosts == nil {
return false
}
return *g.IncludeUngroupedHosts
}

// GetOkIncludeUngroupedHosts returns a tuple with the IncludeUngroupedHosts field if it's non-nil, zero value otherwise
// and a boolean to check if the value has been set.
func (g *GraphDefinition) GetIncludeUngroupedHostsOk() (bool, bool) {
if g == nil || g.IncludeUngroupedHosts == nil {
return false, false
}
return *g.IncludeUngroupedHosts, true
}

// HasIncludeUngroupedHosts returns a boolean if a field has been set.
func (g *GraphDefinition) HasIncludeUngroupedHosts() bool {
if g != nil && g.IncludeUngroupedHosts != nil {
return true
}

return false
}

// GetIncludeUngroupedHosts allocates a new g.IncludeUngroupedHosts and returns the pointer to it.
func (g *GraphDefinition) SetIncludeUngroupedHosts(v bool) {
g.IncludeUngroupedHosts = &v
}

// GetPrecision returns the Precision field if non-nil, zero value otherwise.
func (g *GraphDefinition) GetPrecision() string {
if g == nil || g.Precision == nil {
return ""
}
return *g.Precision
}

// GetOkPrecision returns a tuple with the Precision field if it's non-nil, zero value otherwise
// and a boolean to check if the value has been set.
func (g *GraphDefinition) GetPrecisionOk() (string, bool) {
if g == nil || g.Precision == nil {
return "", false
}
return *g.Precision, true
}

// HasPrecision returns a boolean if a field has been set.
func (g *GraphDefinition) HasPrecision() bool {
if g != nil && g.Precision != nil {
return true
}

return false
}

// GetPrecision allocates a new g.Precision and returns the pointer to it.
func (g *GraphDefinition) SetPrecision(v string) {
g.Precision = &v
}

// GetStyle returns the Style field if non-nil, zero value otherwise.
func (g *GraphDefinition) GetStyle() Style {
if g == nil || g.Style == nil {
return Style{}
}
return *g.Style
}

// GetOkStyle returns a tuple with the Style field if it's non-nil, zero value otherwise
// and a boolean to check if the value has been set.
func (g *GraphDefinition) GetStyleOk() (Style, bool) {
if g == nil || g.Style == nil {
return Style{}, false
}
return *g.Style, true
}

// HasStyle returns a boolean if a field has been set.
func (g *GraphDefinition) HasStyle() bool {
if g != nil && g.Style != nil {
return true
}

return false
}

// GetStyle allocates a new g.Style and returns the pointer to it.
func (g *GraphDefinition) SetStyle(v Style) {
g.Style = &v
}

// GetTextAlign returns the TextAlign field if non-nil, zero value otherwise.
func (g *GraphDefinition) GetTextAlign() string {
if g == nil || g.TextAlign == nil {
return ""
}
return *g.TextAlign
}

// GetOkTextAlign returns a tuple with the TextAlign field if it's non-nil, zero value otherwise
// and a boolean to check if the value has been set.
func (g *GraphDefinition) GetTextAlignOk() (string, bool) {
if g == nil || g.TextAlign == nil {
return "", false
}
return *g.TextAlign, true
}

// HasTextAlign returns a boolean if a field has been set.
func (g *GraphDefinition) HasTextAlign() bool {
if g != nil && g.TextAlign != nil {
return true
}

return false
}

// GetTextAlign allocates a new g.TextAlign and returns the pointer to it.
func (g *GraphDefinition) SetTextAlign(v string) {
g.TextAlign = &v
}

// GetViz returns the Viz field if non-nil, zero value otherwise.
func (g *GraphDefinition) GetViz() string {
if g == nil || g.Viz == nil {
return ""
}
return *g.Viz
}

// GetOkViz returns a tuple with the Viz field if it's non-nil, zero value otherwise
// and a boolean to check if the value has been set.
func (g *GraphDefinition) GetVizOk() (string, bool) {
if g == nil || g.Viz == nil {
return "", false
}
return *g.Viz, true
}

// HasViz returns a boolean if a field has been set.
func (g *GraphDefinition) HasViz() bool {
if g != nil && g.Viz != nil {
return true
}

return false
}

// GetViz allocates a new g.Viz and returns the pointer to it.
func (g *GraphDefinition) SetViz(v string) {
g.Viz = &v
}

// GetLabel returns the Label field if non-nil, zero value otherwise.
func (g *GraphDefinitionMarker) GetLabel() string {
if g == nil || g.Label == nil {
Expand Down
Loading