Class: Google::Apis::BigqueryV2::Routine

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

Overview

A user-defined function or a stored procedure.

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) ⇒ Routine

Returns a new instance of Routine.



4582
4583
4584
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4582

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

Instance Attribute Details

#argumentsArray<Google::Apis::BigqueryV2::Argument>

Optional. Corresponds to the JSON property arguments



4505
4506
4507
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4505

def arguments
  @arguments
end

#creation_timeFixnum

Output only. The time when this routine was created, in milliseconds since the epoch. Corresponds to the JSON property creationTime

Returns:

  • (Fixnum)


4511
4512
4513
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4511

def creation_time
  @creation_time
end

#definition_bodyString

Required. The body of the routine. For functions, this is the expression in the AS clause. If language=SQL, it is the substring inside (but excluding) the parentheses. For example, for the function created with the following statement: CREATE FUNCTION JoinLines(x string, y string) as (concat(x, "\n", y)) The definition_body is concat(x, "\n", y) (\n is not replaced with linebreak). If language=JAVASCRIPT, it is the evaluated string in the AS clause. For example, for the function created with the following statement: CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return "\n";\n' The definition_body is return "\n";\n Note that both \n are replaced with linebreaks. Corresponds to the JSON property definitionBody

Returns:

  • (String)


4529
4530
4531
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4529

def definition_body
  @definition_body
end

#descriptionString

Optional. [Experimental] The description of the routine if defined. Corresponds to the JSON property description

Returns:

  • (String)


4534
4535
4536
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4534

def description
  @description
end

#etagString

Output only. A hash of this resource. Corresponds to the JSON property etag

Returns:

  • (String)


4539
4540
4541
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4539

def etag
  @etag
end

#imported_librariesArray<String>

Optional. If language = "JAVASCRIPT", this field stores the path of the imported JAVASCRIPT libraries. Corresponds to the JSON property importedLibraries

Returns:

  • (Array<String>)


4545
4546
4547
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4545

def imported_libraries
  @imported_libraries
end

#languageString

Optional. Defaults to "SQL". Corresponds to the JSON property language

Returns:

  • (String)


4550
4551
4552
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4550

def language
  @language
end

#last_modified_timeFixnum

Output only. The time when this routine was last modified, in milliseconds since the epoch. Corresponds to the JSON property lastModifiedTime

Returns:

  • (Fixnum)


4556
4557
4558
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4556

def last_modified_time
  @last_modified_time
end

#return_typeGoogle::Apis::BigqueryV2::StandardSqlDataType

The type of a variable, e.g., a function argument. Examples: INT64: type_kind="INT64" ARRAY: type_kind="ARRAY", array_element_type="STRING" STRUCT>: type_kind="STRUCT", struct_type=fields=[ name="x", type=type_kind="STRING", `name="y", type=`type_kind="ARRAY", array_element_type="DATE" ]` Corresponds to the JSON propertyreturnType`



4570
4571
4572
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4570

def return_type
  @return_type
end

#routine_referenceGoogle::Apis::BigqueryV2::RoutineReference

Required. Reference describing the ID of this routine. Corresponds to the JSON property routineReference



4575
4576
4577
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4575

def routine_reference
  @routine_reference
end

#routine_typeString

Required. The type of routine. Corresponds to the JSON property routineType

Returns:

  • (String)


4580
4581
4582
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4580

def routine_type
  @routine_type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4587

def update!(**args)
  @arguments = args[:arguments] if args.key?(:arguments)
  @creation_time = args[:creation_time] if args.key?(:creation_time)
  @definition_body = args[:definition_body] if args.key?(:definition_body)
  @description = args[:description] if args.key?(:description)
  @etag = args[:etag] if args.key?(:etag)
  @imported_libraries = args[:imported_libraries] if args.key?(:imported_libraries)
  @language = args[:language] if args.key?(:language)
  @last_modified_time = args[:last_modified_time] if args.key?(:last_modified_time)
  @return_type = args[:return_type] if args.key?(:return_type)
  @routine_reference = args[:routine_reference] if args.key?(:routine_reference)
  @routine_type = args[:routine_type] if args.key?(:routine_type)
end