Class: Google::Apis::DriveV2::TeamDrive::BackgroundImageFile

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

Overview

An image file and cropping parameters from which a background image for this Team Drive is set. This is a write only field that can only be set on a drive. teamdrives.update request that does not set themeId. When specified, all fields of the backgroundImageFile must be set.

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

Returns a new instance of BackgroundImageFile



3026
3027
3028
# File 'generated/google/apis/drive_v2/classes.rb', line 3026

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

Instance Attribute Details

#idString

The ID of an image file in Drive to use for the background image. Corresponds to the JSON property id

Returns:

  • (String)


3000
3001
3002
# File 'generated/google/apis/drive_v2/classes.rb', line 3000

def id
  @id
end

#widthFloat

The width of the cropped image in the closed range of 0 to 1, which is the width of the cropped image divided by the width of the entire image. The height is computed by applying a width to height aspect ratio of 80 to 9. The resulting image must be at least 1280 pixels wide and 144 pixels high. Corresponds to the JSON property width

Returns:

  • (Float)


3008
3009
3010
# File 'generated/google/apis/drive_v2/classes.rb', line 3008

def width
  @width
end

#x_coordinateFloat

The X coordinate of the upper left corner of the cropping area in the background image. This is a value in the closed range of 0 to 1 which is the horizontal distance from the left side of the entire image to the left side of the cropping area divided by the width of the entire image. Corresponds to the JSON property xCoordinate

Returns:

  • (Float)


3016
3017
3018
# File 'generated/google/apis/drive_v2/classes.rb', line 3016

def x_coordinate
  @x_coordinate
end

#y_coordinateFloat

The Y coordinate of the upper left corner of the cropping area in the background image. This is a value in the closed range of 0 to 1 which is the vertical distance from the top side of the entire image to the top side of the cropping area divided by the height of the entire image. Corresponds to the JSON property yCoordinate

Returns:

  • (Float)


3024
3025
3026
# File 'generated/google/apis/drive_v2/classes.rb', line 3024

def y_coordinate
  @y_coordinate
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3031
3032
3033
3034
3035
3036
# File 'generated/google/apis/drive_v2/classes.rb', line 3031

def update!(**args)
  @id = args[:id] if args.key?(:id)
  @width = args[:width] if args.key?(:width)
  @x_coordinate = args[:x_coordinate] if args.key?(:x_coordinate)
  @y_coordinate = args[:y_coordinate] if args.key?(:y_coordinate)
end