@@ -250,7 +250,7 @@ def download_to_filename(self, filename):
250250
251251 mtime = time .mktime (
252252 datetime .datetime .strptime (
253- self ._properties ['updated' ],
253+ self ._get_properties () ['updated' ],
254254 '%Y-%m-%dT%H:%M:%S.%fz' ).timetuple ()
255255 )
256256 os .utime (file_obj .name , (mtime , mtime ))
@@ -304,7 +304,8 @@ def upload_from_file(self, file_obj, rewind=False, size=None,
304304 :type num_retries: integer
305305 :param num_retries: Number of upload retries. Defaults to 6.
306306 """
307- content_type = (content_type or self ._properties .get ('contentType' ) or
307+ content_type = (content_type or
308+ self ._get_properties ().get ('contentType' ) or
308309 'application/octet-stream' )
309310
310311 # Rewind the file if desired.
@@ -358,7 +359,7 @@ def upload_from_file(self, file_obj, rewind=False, size=None,
358359 if not isinstance (response_content ,
359360 six .string_types ): # pragma: NO COVER Python3
360361 response_content = response_content .decode ('utf-8' )
361- self ._properties = json .loads (response_content )
362+ self ._set_properties ( json .loads (response_content ) )
362363
363364 def upload_from_filename (self , filename , content_type = None ):
364365 """Upload this blob's contents from the content of a named file.
@@ -385,7 +386,8 @@ def upload_from_filename(self, filename, content_type=None):
385386 :type content_type: string or ``NoneType``
386387 :param content_type: Optional type of content being uploaded.
387388 """
388- content_type = content_type or self ._properties .get ('contentType' )
389+ content_type = (content_type or
390+ self ._get_properties ().get ('contentType' ))
389391 if content_type is None :
390392 content_type , _ = mimetypes .guess_type (filename )
391393
@@ -500,7 +502,7 @@ def component_count(self):
500502 ``None`` if the property is not set locally. This property
501503 will not be set on objects not created via ``compose``.
502504 """
503- component_count = self ._properties .get ('componentCount' )
505+ component_count = self ._get_properties () .get ('componentCount' )
504506 if component_count is not None :
505507 return int (component_count )
506508
@@ -514,7 +516,7 @@ def etag(self):
514516 :rtype: string or ``NoneType``
515517 :returns: The blob etag or ``None`` if the property is not set locally.
516518 """
517- return self ._properties .get ('etag' )
519+ return self ._get_properties () .get ('etag' )
518520
519521 @property
520522 def generation (self ):
@@ -526,7 +528,7 @@ def generation(self):
526528 :returns: The generation of the blob or ``None`` if the property
527529 is not set locally.
528530 """
529- generation = self ._properties .get ('generation' )
531+ generation = self ._get_properties () .get ('generation' )
530532 if generation is not None :
531533 return int (generation )
532534
@@ -540,7 +542,7 @@ def id(self):
540542 :returns: The ID of the blob or ``None`` if the property is not
541543 set locally.
542544 """
543- return self ._properties .get ('id' )
545+ return self ._get_properties () .get ('id' )
544546
545547 md5_hash = _scalar_property ('md5Hash' )
546548 """MD5 hash for this object.
@@ -563,7 +565,7 @@ def media_link(self):
563565 :returns: The media link for the blob or ``None`` if the property is
564566 not set locally.
565567 """
566- return self ._properties .get ('mediaLink' )
568+ return self ._get_properties () .get ('mediaLink' )
567569
568570 @property
569571 def metadata (self ):
@@ -575,7 +577,7 @@ def metadata(self):
575577 :returns: The metadata associated with the blob or ``None`` if the
576578 property is not set locally.
577579 """
578- return copy .deepcopy (self ._properties .get ('metadata' ))
580+ return copy .deepcopy (self ._get_properties () .get ('metadata' ))
579581
580582 @metadata .setter
581583 def metadata (self , value ):
@@ -598,7 +600,7 @@ def metageneration(self):
598600 :returns: The metageneration of the blob or ``None`` if the property
599601 is not set locally.
600602 """
601- metageneration = self ._properties .get ('metageneration' )
603+ metageneration = self ._get_properties () .get ('metageneration' )
602604 if metageneration is not None :
603605 return int (metageneration )
604606
@@ -612,7 +614,7 @@ def owner(self):
612614 :returns: Mapping of owner's role/ID. If the property is not set
613615 locally, returns ``None``.
614616 """
615- return copy .deepcopy (self ._properties .get ('owner' ))
617+ return copy .deepcopy (self ._get_properties () .get ('owner' ))
616618
617619 @property
618620 def self_link (self ):
@@ -624,7 +626,7 @@ def self_link(self):
624626 :returns: The self link for the blob or ``None`` if the property is
625627 not set locally.
626628 """
627- return self ._properties .get ('selfLink' )
629+ return self ._get_properties () .get ('selfLink' )
628630
629631 @property
630632 def size (self ):
@@ -636,7 +638,7 @@ def size(self):
636638 :returns: The size of the blob or ``None`` if the property
637639 is not set locally.
638640 """
639- size = self ._properties .get ('size' )
641+ size = self ._get_properties () .get ('size' )
640642 if size is not None :
641643 return int (size )
642644
@@ -652,7 +654,7 @@ def storage_class(self):
652654 :returns: If set, one of "STANDARD", "NEARLINE", or
653655 "DURABLE_REDUCED_AVAILABILITY", else ``None``.
654656 """
655- return self ._properties .get ('storageClass' )
657+ return self ._get_properties () .get ('storageClass' )
656658
657659 @property
658660 def time_deleted (self ):
@@ -665,7 +667,7 @@ def time_deleted(self):
665667 set locally. If the blob has not been deleted, this will
666668 never be set.
667669 """
668- return self ._properties .get ('timeDeleted' )
670+ return self ._get_properties () .get ('timeDeleted' )
669671
670672 @property
671673 def updated (self ):
@@ -677,7 +679,7 @@ def updated(self):
677679 :returns: RFC3339 valid timestamp, or ``None`` if the property is not
678680 set locally.
679681 """
680- return self ._properties .get ('updated' )
682+ return self ._get_properties () .get ('updated' )
681683
682684
683685class _UploadConfig (object ):
0 commit comments