    # File lib/fog/aws/models/beanstalk/environment.rb, line 91
            def version=(new_version)
              requires :id
              if new_version.is_a?(String)
                new_version_label = new_version
              elsif new_version.is_a?(Fog::AWS::ElasticBeanstalk::Version)
                new_version_label = new_version.label
              else
                raise "Unknown type for new_version, must be either String or Fog::AWS::ElasticBeanstalk::Version"
              end

              if new_version.nil?
                raise "Version label not specified."
              end

              data = service.update_environment({
                  'EnvironmentId' => id,
                  'VersionLabel' => new_version_label
                                            }).body['UpdateEnvironmentResult']

              merge_attributes(data)
            end