Class: Types::Terraform::StateVersionType

Inherits:
BaseObject
  • Object
show all
Includes:
API::Helpers::RelatedResourcesHelpers
Defined in:
app/graphql/types/terraform/state_version_type.rb

Instance Method Summary collapse

Methods included from API::Helpers::RelatedResourcesHelpers

#expose_path, #expose_url, #issues_available?, #mrs_available?

Methods inherited from BaseObject

accepts, assignable?, authorization, authorize, authorized?, #current_user, #id

Methods included from Gitlab::Graphql::Present

#present, #unpresented

Instance Method Details

#created_by_userObject


42
43
44
# File 'app/graphql/types/terraform/state_version_type.rb', line 42

def created_by_user
  Gitlab::Graphql::Loaders::BatchModelLoader.new(User, object.created_by_user_id).find
end

#download_pathObject


46
47
48
49
50
51
52
# File 'app/graphql/types/terraform/state_version_type.rb', line 46

def download_path
  expose_path api_v4_projects_terraform_state_versions_path(
    id: object.project_id,
    name: object.terraform_state.name,
    serial: object.version
  )
end

#jobObject


54
55
56
# File 'app/graphql/types/terraform/state_version_type.rb', line 54

def job
  Gitlab::Graphql::Loaders::BatchModelLoader.new(::Ci::Build, object.ci_build_id).find
end