<commit_before>%% -*- erlang-indent-level: 4;indent-tabs-mode: nil; fill-column: 92 -*-
%% ex: ts=4 sw=4 et
%% @author <NAME> <<EMAIL>>
%% Copyright 2013 Opscode, Inc. All Rights Reserved.

-module(oc_chef_container).

-include("oc_chef_types.hrl").
-include_lib("mixer/include/mixer.hrl").

-behaviour(chef_object).

-export([
         assemble_container_ejson/1,
         parse_binary_json/1
        ]).

%% chef_object behaviour callbacks
-export([
         authz_id/1,
         bulk_get_query/0,
         create_query/0,
         delete_query/0,
         ejson_for_indexing/2,
         fields_for_fetch/1,
         fields_for_update/1,
         find_query/0,
         id/1,
         is_indexed/0,
         list/2,
         list_query/0,
         name/1,
         new_record/3,
         org_id/1,
         record_fields/0,
         set_created/2,
         set_updated/2,
         type_name/1,
         update_from_ejson/2,
         update_query/0
        ]).

-mixin([
        {chef_object, [{default_fetch/2, fetch}]}
       ]).

name(#oc_chef_container{name = Name}) ->
    Name.

id(#oc_chef_container{id = Id}) ->
    Id.

type_name(#oc_chef_container{}) ->
    container.

authz_id(#oc_chef_container{authz_id = AuthzId}) ->
    AuthzId.

org_id(#oc_chef_container{org_id = OrgId}) ->
    OrgId.
<commit_msg>Add update support per chef_object consolidation<commit_after>%% -*- erlang-indent-level: 4;indent-tabs-mode: nil; fill-column: 92 -*-
%% ex: ts=4 sw=4 et
%% @author <NAME> <<EMAIL>>
%% Copyright 2013 Opscode, Inc. All Rights Reserved.

-module(oc_chef_container).

-include("oc_chef_types.hrl").
-include_lib("mixer/include/mixer.hrl").

-behaviour(chef_object).

-export([
         assemble_container_ejson/1,
         parse_binary_json/1
        ]).

%% chef_object behaviour callbacks
-export([
         authz_id/1,
         bulk_get_query/0,
         create_query/0,
         delete_query/0,
         ejson_for_indexing/2,
         fields_for_fetch/1,
         fields_for_update/1,
         find_query/0,
         id/1,
         is_indexed/0,
         list/2,
         list_query/0,
         name/1,
         new_record/3,
         org_id/1,
         record_fields/0,
         set_created/2,
         set_updated/2,
         type_name/1,
         update_from_ejson/2,
         update_query/0
        ]).

-mixin([
        {chef_object, [{default_fetch/2, fetch},
                       {default_update/2, update}]}
       ]).

name(#oc_chef_container{name = Name}) ->
    Name.

id(#oc_chef_container{id = Id}) ->
    Id.

type_name(#oc_chef_container{}) ->
    container.

authz_id(#oc_chef_container{authz_id = AuthzId}) ->
    AuthzId.

org_id(#oc_chef_container{org_id = OrgId}) ->
    OrgId.

{'fraction_non_alphanumeric': 0.13502575423105223, 'fraction_numerical': 0.024650478292862398, 'mean_word_length': 2.118119266055046, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2101447', 'n_tokens_mistral': 1027, 'n_tokens_neox': 996, 'n_words': 147}