## Modulemd.Defaults Modulemd.Defaults — Parent class for Default documents. See ModulemdDefaultsV1 for a specific type. |

## Stability Level

Stable, unless otherwise indicated

## Functions

ModulemdDefaults * | modulemd_defaults_new ()
ModulemdDefaults * | modulemd_defaults_copy ()
gboolean | modulemd_defaults_validate ()
gboolean | modulemd_defaults_equals ()
ModulemdDefaults * | modulemd_defaults_upgrade ()
const gchar * | modulemd_defaults_get_module_name ()
guint64 | modulemd_defaults_get_mdversion ()
void | modulemd_defaults_set_modified ()
guint64 | modulemd_defaults_get_modified ()

## Properties

guint64 | mdversion | Read
char * | module-name | Read / Write / Construct Only

## Types and Values

enum | ModulemdDefaultsVersionEnum
#define | MODULEMD_TYPE_DEFAULTS
struct | ModulemdDefaultsClass
| ModulemdDefaults

## Object Hierarchy

        GEnum
        ╰── ModulemdDefaultsVersionEnum
        GObject
        ╰── ModulemdDefaults
            ╰── ModulemdDefaultsV1

## Description

## Functions

### modulemd_defaults_new ()

    ModulemdDefaults *
    modulemd_defaults_new (guint64 version,
                           const gchar *module_name);

Create a new ModulemdDefaults.

#### Parameters

version | The version of the defaults metadata to create. |
module_name | The name of the module to which these defaults apply. |

#### Returns

A newly created ModulemdDefaults subtype of the requested version.

[transfer full]

Since: 2.0

### modulemd_defaults_copy ()

    ModulemdDefaults *
    modulemd_defaults_copy (ModulemdDefaults *self);

#### Parameters

self | This ModulemdDefaults object. | [in]

#### Returns

A newly-allocated copy of `self` .

[transfer full]

Since: 2.0

### modulemd_defaults_validate ()

    gboolean
    modulemd_defaults_validate (ModulemdDefaults *self,
                                GError **error);

#### Parameters

self | This ModulemdDefaults object. | [in]
error | A GError that will return the reason for a validation error. | [out]

#### Returns

TRUE if validation passed, FALSE and sets `error` appropriately if validation failed.

Since: 2.0

### modulemd_defaults_equals ()

    gboolean
    modulemd_defaults_equals (ModulemdDefaults *self_1,
                              ModulemdDefaults *self_2);

#### Parameters

self_1 | A ModulemdDefaults object. | [in]
self_2 | A ModulemdDefaults object. | [in]

#### Returns

TRUE if both `self_1` and `self_2` contain equal values, FALSE if they differed.

Since: 2.2

### modulemd_defaults_upgrade ()

    ModulemdDefaults *
    modulemd_defaults_upgrade (ModulemdDefaults *self,
                               guint64 mdversion,
                               GError **error);

#### Parameters

self | This ModulemdDefaults object. | [in]
mdversion | The version to upgrade to. | [in]
error | A GError that will return the reason for an upgrade error. | [out]

#### Returns

A newly-allocated copy of `self` upgraded to the requested defaults version. NULL if the upgrade cannot be performed and sets `error` appropriately. This function does not modify `self` .

[transfer full]

Since: 2.0

### modulemd_defaults_get_module_name ()

    const gchar *
    modulemd_defaults_get_module_name (ModulemdDefaults *self);

#### Parameters

self | This ModulemdDefaults object. | [in]

#### Returns

The name of the module to which these defaults apply.

[transfer none]

Since: 2.0

### modulemd_defaults_get_mdversion ()

    guint64
    modulemd_defaults_get_mdversion (ModulemdDefaults *self);

#### Parameters

self | This ModulemdDefaults object. | [in]

#### Returns

The metadata version of this defaults object.

Since: 2.0

### modulemd_defaults_set_modified ()

    void
    modulemd_defaults_set_modified (ModulemdDefaults *self,
                                    guint64 modified);

#### Parameters

self | This ModulemdDefaults object. | [in]
modified | The last modified time represented as a 64-bit integer (such as 201807011200). | [in]

Since: 2.0

### modulemd_defaults_get_modified ()

    guint64
    modulemd_defaults_get_modified (ModulemdDefaults *self);

#### Parameters

self | This ModulemdDefaults object. | [in]

#### Returns

The last modified time represented as a 64-bit integer (such as 201807011200)

Since: 2.0

## Types and Values

### enum ModulemdDefaultsVersionEnum

#### Members

MD_DEFAULTS_VERSION_ERROR | Represents an error handling mdversion. |
MD_DEFAULTS_VERSION_UNSET | Represents an unset mdversion. |
MD_DEFAULTS_VERSION_ONE | Represents v1 of the ModulemdDefaults metadata format. |
MD_DEFAULTS_VERSION_LATEST | Represents the highest-supported version of the ModulemdDefaults metadata format. |

Since: 2.0

### MODULEMD_TYPE_DEFAULTS

    #define MODULEMD_TYPE_DEFAULTS (modulemd_defaults_get_type ())

### struct ModulemdDefaultsClass

    struct ModulemdDefaultsClass {
      GObjectClass parent_class;

      ModulemdDefaults *(*copy) (ModulemdDefaults *self);

      gboolean (*validate) (ModulemdDefaults *self, GError **error);

      guint64 (*get_mdversion) (ModulemdDefaults *self);

      gboolean (*equals) (ModulemdDefaults *self_1, ModulemdDefaults *self_2);

      /* Padding to allow adding up to 9 new virtual functions without
       * breaking ABI. */
      gpointer padding[9];
    };

### ModulemdDefaults

    typedef struct _ModulemdDefaults ModulemdDefaults;

## Property Details

### The `“mdversion”` property

      “mdversion”                guint64

The metadata version of this Defaults object. Read-only.

Owner: ModulemdDefaults

Flags: Read

Allowed values: <= 1

Default value: 0

### The `“module-name”` property

      “module-name”              char *

The name of the module to which these defaults apply.

Owner: ModulemdDefaults

Flags: Read / Write / Construct Only

Default value: "__NAME_UNSET__"