Class: Google::Apis::FirebaseremoteconfigV1::RemoteConfig

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/firebaseremoteconfig_v1/classes.rb,
generated/google/apis/firebaseremoteconfig_v1/representations.rb,
generated/google/apis/firebaseremoteconfig_v1/representations.rb

Overview

* The RemoteConfig consists of a list of conditions (which can be thought of as named "if" statements) and a map of parameters (parameter key to a stucture containing an optional default value, as well as a optional submap of (condition name to value when that condition is true).

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ RemoteConfig

Returns a new instance of RemoteConfig



61
62
63
# File 'generated/google/apis/firebaseremoteconfig_v1/classes.rb', line 61

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#conditionsArray<Google::Apis::FirebaseremoteconfigV1::RemoteConfigCondition>

The list of named conditions. The order does affect the semantics. The condition_name values of these entries must be unique. The resolved value of a config parameter P is determined as follow:

  • Let Y be the set of values from the submap of P that refer to conditions that evaluate to true.
  • If Y is non empty, the value is taken from the specific submap in Y whose condition_name is the earliest in this condition list.
  • Else, if P has a default value option (condition_name is empty) then the value is taken from that option.
  • Else, parameter P has no value and is omitted from the config result. Example: parameter key "p1", default value "v1", submap specified as "c1": v2, "c2": v3 where "c1" and "c2" are names of conditions in the condition list (where "c1" in this example appears before "c2"). The value of p1 would be v2 as long as c1 is true. Otherwise, if c2 is true, p1 would evaluate to v3, and if c1 and c2 are both false, p1 would evaluate to v1. If no default value was specified, and c1 and c2 were both false, no value for p1 would be generated. Corresponds to the JSON property conditions


52
53
54
# File 'generated/google/apis/firebaseremoteconfig_v1/classes.rb', line 52

def conditions
  @conditions
end

#parametersHash<String,Google::Apis::FirebaseremoteconfigV1::RemoteConfigParameter>

Map of parameter keys to their optional default values and optional submap of (condition name : value). Order doesn't affect semantics, and so is sorted by the server. The 'key' values of the params must be unique. Corresponds to the JSON property parameters



59
60
61
# File 'generated/google/apis/firebaseremoteconfig_v1/classes.rb', line 59

def parameters
  @parameters
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



66
67
68
69
# File 'generated/google/apis/firebaseremoteconfig_v1/classes.rb', line 66

def update!(**args)
  @conditions = args[:conditions] if args.key?(:conditions)
  @parameters = args[:parameters] if args.key?(:parameters)
end